Skip to content

Commit

Permalink
Fix for upload on IOS (#161)
Browse files Browse the repository at this point in the history
Co-authored-by: Adam Engsig <adamengsig@gmail.com>
  • Loading branch information
nuller1joe and Adam Engsig authored Oct 12, 2022
1 parent 8bb8022 commit eba731d
Showing 1 changed file with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,21 @@ export default class ROMSourceSelector extends Component {
}

loadLocalFile(event) {
if(!event.target.files[0].name.endsWith(".zip") &&
!event.target.files[0].name.endsWith(".gb") &&
!event.target.files[0].name.endsWith(".gbc")) {
this.state.confirmationModal.showConfirmationModal({
title: "Fail - " + event.target.files[0].name,
contentElement: (
<div>
Uploaded ROM had a unknown filetype. Confirm it is correct.
</div>
)
});

return;
}

const loadROMTask = async () => {
await WasmBoy.pause();
await WasmBoy.loadROM(event.target.files[0]);
Expand Down Expand Up @@ -340,7 +355,7 @@ export default class ROMSourceSelector extends Component {
type="file"
id="ROMFileInput"
class="hidden"
accept=".gb, .gbc, .zip"
accept="*"
value={undefined}
onChange={event => {
this.loadLocalFile(event);
Expand Down

0 comments on commit eba731d

Please sign in to comment.