Skip to content

Commit

Permalink
feat: alert users that 7z files won't work unless extracted
Browse files Browse the repository at this point in the history
  • Loading branch information
NikhilNarayana committed Jan 17, 2022
1 parent 64b0221 commit d84ec5c
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/renderer/containers/QuickStart/IsoSelectionStep.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ const ErrorMessage = styled.div`

export const IsoSelectionStep: React.FC = () => {
const [tempIsoPath, setTempIsoPath] = React.useState("");
const [errMsg, setErrMsg] = React.useState("");
const [forceErr, setForceErr] = React.useState(false);
const verification = ipc_checkValidIso.renderer!.useValue(
{ path: tempIsoPath },
{ path: tempIsoPath, valid: IsoValidity.INVALID },
Expand All @@ -74,12 +76,20 @@ export const IsoSelectionStep: React.FC = () => {
}

const filePath = acceptedFiles[0].path;
if (filePath.endsWith(".7z")) {
setErrMsg("7z files must be uncompressed with 7-zip to be used in Dolphin.");
setForceErr(true);
return;
}
setErrMsg("Provided ISO will not work with Slippi Online. Please provide an NTSC 1.02 ISO.");
setForceErr(false);

setTempIsoPath(filePath);
};
const validIsoPath = verification.value.valid;

const { open, getRootProps, getInputProps, isDragActive, isDragAccept, isDragReject } = useDropzone({
accept: [".iso", ".gcm", ".gcz"],
accept: [".iso", ".gcm", ".gcz", ".7z"],
onDrop: onDrop,
multiple: false,
noClick: true,
Expand Down Expand Up @@ -119,9 +129,7 @@ export const IsoSelectionStep: React.FC = () => {
</Button>
)}
<p>{loading ? "Verifying ISO..." : "or drag and drop here"}</p>
{invalidIso && (
<ErrorMessage>Provided ISO will not work with Slippi Online. Please provide an NTSC 1.02 ISO.</ErrorMessage>
)}
{(invalidIso || forceErr) && <ErrorMessage>{errMsg}</ErrorMessage>}
</Container>

<ConfirmationModal
Expand Down

0 comments on commit d84ec5c

Please sign in to comment.