Skip to content

Commit

Permalink
remove clear temp dir button
Browse files Browse the repository at this point in the history
fixes #44
  • Loading branch information
jmlee337 committed Dec 21, 2024
1 parent af1f786 commit 5aaf8e1
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 65 deletions.
4 changes: 2 additions & 2 deletions src/main/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ const createWindow = async () => {
mainWindow = new BrowserWindow({
show: false,
width: 1024,
minWidth: 700,
minWidth: 800,
height: 728,
minHeight: 650,
minHeight: 692,
icon: getAssetPath('icon.png'),
webPreferences: {
preload: app.isPackaged
Expand Down
81 changes: 18 additions & 63 deletions src/renderer/Settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import {
Checkbox,
CircularProgress,
Dialog,
DialogActions,
DialogContent,
DialogContentText,
DialogTitle,
Expand All @@ -26,7 +25,6 @@ import {
CheckCircle,
CloudDownload,
ContentCopy,
DeleteForever,
Report,
SdCard,
Settings as SettingsIcon,
Expand Down Expand Up @@ -219,9 +217,6 @@ export default function Settings({
setHasAutoOpened(true);
}

const [clearConfirmOpen, setClearConfirmOpen] = useState(false);
const [clearing, setClearing] = useState(false);

return (
<>
<Button
Expand Down Expand Up @@ -548,6 +543,24 @@ export default function Settings({
</Box>
)}
</Stack>
<Stack alignItems="end" marginRight="8px" spacing="8px">
<Button
onClick={() => {
window.electron.openOverlayDir();
}}
variant="contained"
>
Open Overlay Folder
</Button>
<Button
onClick={() => {
window.electron.openTempDir();
}}
variant="contained"
>
Open Temp Folder
</Button>
</Stack>
{needUpdate && (
<Alert
severity="warning"
Expand All @@ -568,64 +581,6 @@ export default function Settings({
</Alert>
)}
</DialogContent>
<DialogActions>
<Button
onClick={() => {
window.electron.openOverlayDir();
}}
variant="contained"
>
Open Overlay Folder
</Button>
<Button
onClick={() => {
window.electron.openTempDir();
}}
variant="contained"
>
Open Temp Folder
</Button>
<Tooltip arrow title="Clear Temp Folder">
<IconButton
onClick={() => {
setClearConfirmOpen(true);
}}
>
<DeleteForever />
</IconButton>
</Tooltip>
<Dialog
open={clearConfirmOpen}
onClose={() => {
setClearConfirmOpen(false);
}}
>
<DialogTitle>Clear Temp Folder?</DialogTitle>
<DialogContent>
<Alert severity="warning">
This will delete all unzipped replays and dolphin comm files.DO
NOT PROCEED if you are currently playing replays.
</Alert>
</DialogContent>
<DialogActions>
<Button
disabled={clearing}
onClick={async () => {
try {
setClearing(true);
await window.electron.clearTempDir();
setClearConfirmOpen(false);
} finally {
setClearing(false);
}
}}
variant="contained"
>
Clear Temp Folder
</Button>
</DialogActions>
</Dialog>
</DialogActions>
</Dialog>
</>
);
Expand Down

0 comments on commit 5aaf8e1

Please sign in to comment.