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));
|
||||
}
|
||||
}
|
||||
@ -132,7 +132,7 @@ export const Drives = ({ cpu, io, sectors, enhanced, ready }: DrivesProps) => {
|
||||
const setSmartData = [setSmartData1, setSmartData2];
|
||||
const callbacks: Callbacks = {
|
||||
driveLight: (drive, on) => {
|
||||
setData[drive - 1]?.(data => ({...data, on }));
|
||||
setData[drive - 1]?.(data => ({ ...data, on }));
|
||||
},
|
||||
label: (drive, name, side) => {
|
||||
setData[drive - 1]?.(data => ({
|
||||
@ -148,7 +148,7 @@ export const Drives = ({ cpu, io, sectors, enhanced, ready }: DrivesProps) => {
|
||||
|
||||
const smartPortCallbacks: Callbacks = {
|
||||
driveLight: (drive, on) => {
|
||||
setSmartData[drive - 1]?.(data => ({...data, on }));
|
||||
setSmartData[drive - 1]?.(data => ({ ...data, on }));
|
||||
},
|
||||
label: (drive, name, side) => {
|
||||
setSmartData[drive - 1]?.(data => ({
|
||||
@ -157,7 +157,7 @@ export const Drives = ({ cpu, io, sectors, enhanced, ready }: DrivesProps) => {
|
||||
side,
|
||||
}));
|
||||
},
|
||||
dirty: () => {/* Unused */}
|
||||
dirty: () => {/* Unused */ }
|
||||
};
|
||||
|
||||
if (cpu && io) {
|
||||
|
@ -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