mirror of
https://github.com/whscullin/apple2js.git
synced 2024-01-12 14:14:38 +00:00
More file modal fixes
This commit is contained in:
parent
ac336b3cce
commit
a5256ae134
|
@ -115,7 +115,7 @@ export const Drives = ({ cpu, io, sectors, enhanced, ready }: DrivesProps) => {
|
|||
setTotal(0);
|
||||
}));
|
||||
} else {
|
||||
const url = isHttp ? hashPart : `/json/disks/${hashPart}.json`;
|
||||
const url = isHttp ? hashPart : `json/disks/${hashPart}.json`;
|
||||
loadJSON(disk2, drive, url).catch((e) => setError(e));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -51,8 +51,7 @@ export const FileModal = ({ disk2, number, onClose, isOpen }: FileModalProps) =>
|
|||
useEffect(() => {
|
||||
spawn(async () => {
|
||||
try {
|
||||
const indexRequest = fetch('json/disks/index.json');
|
||||
const indexResponse = await indexRequest;
|
||||
const indexResponse = await fetch('json/disks/index.json');
|
||||
const index = await indexResponse.json() as IndexEntry[];
|
||||
setIndex(index);
|
||||
} catch (error) {
|
||||
|
@ -125,7 +124,7 @@ export const FileModal = ({ disk2, number, onClose, isOpen }: FileModalProps) =>
|
|||
);
|
||||
const categoryNames = Object.keys(categories).sort();
|
||||
|
||||
const disks = category ? categories[category] : [];
|
||||
const disks = category ? categories[category].sort() : [];
|
||||
|
||||
return (
|
||||
<>
|
||||
|
|
Loading…
Reference in New Issue
Block a user