Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added a warning dialog appeared when selecting hybrid 128G mode #2158

Merged
merged 1 commit into from
Sep 22, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import { usePrefs } from '@chia-network/api-react';
import {
AdvancedOptions,
AlertDialog,
ButtonSelected,
CardStep,
Flex,
TextField,
Checkbox,
TooltipIcon,
RadioGroup,
useOpenDialog,
} from '@chia-network/core';
import { Trans } from '@lingui/macro';
import { FormControl, FormControlLabel, Typography, Radio } from '@mui/material';
Expand Down Expand Up @@ -38,6 +40,7 @@ export default function PlotAddSelectHybridDiskMode(props: Props) {
const hasWorkspaceLocation2 = !!workspaceLocation2;

const hybridDiskMode = watch('bladebitEnableHybridDiskMode', false);
const openDialog = useOpenDialog();

const handleSelect = React.useCallback(async () => {
const location = await selectDirectory({ defaultPath: defaultTmpDirPath || undefined });
Expand All @@ -62,11 +65,23 @@ export default function PlotAddSelectHybridDiskMode(props: Props) {
setValue('workspaceLocation', undefined);
setValue('workspaceLocation2', undefined);
setValue('bladebitEnableHybridDiskMode', false);
} else {
setValue('bladebitEnableHybridDiskMode', value);
return;
}

if (value === '128') {
openDialog(
<AlertDialog title={<Trans>Warning</Trans>}>
<Trans>
Before beginning the plotting process, ensure that you have at least 128GB of RAM available. If you are
running low on additional memory space, we strongly advise closing all other applications to prevent
memory errors.
</Trans>
</AlertDialog>
);
}
setValue('bladebitEnableHybridDiskMode', value);
},
[setValue]
[setValue, openDialog]
);

return (
Expand Down