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);
|
setTotal(0);
|
||||||
}));
|
}));
|
||||||
} else {
|
} 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));
|
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 setSmartData = [setSmartData1, setSmartData2];
|
||||||
const callbacks: Callbacks = {
|
const callbacks: Callbacks = {
|
||||||
driveLight: (drive, on) => {
|
driveLight: (drive, on) => {
|
||||||
setData[drive - 1]?.(data => ({...data, on }));
|
setData[drive - 1]?.(data => ({ ...data, on }));
|
||||||
},
|
},
|
||||||
label: (drive, name, side) => {
|
label: (drive, name, side) => {
|
||||||
setData[drive - 1]?.(data => ({
|
setData[drive - 1]?.(data => ({
|
||||||
|
@ -148,7 +148,7 @@ export const Drives = ({ cpu, io, sectors, enhanced, ready }: DrivesProps) => {
|
||||||
|
|
||||||
const smartPortCallbacks: Callbacks = {
|
const smartPortCallbacks: Callbacks = {
|
||||||
driveLight: (drive, on) => {
|
driveLight: (drive, on) => {
|
||||||
setSmartData[drive - 1]?.(data => ({...data, on }));
|
setSmartData[drive - 1]?.(data => ({ ...data, on }));
|
||||||
},
|
},
|
||||||
label: (drive, name, side) => {
|
label: (drive, name, side) => {
|
||||||
setSmartData[drive - 1]?.(data => ({
|
setSmartData[drive - 1]?.(data => ({
|
||||||
|
@ -157,7 +157,7 @@ export const Drives = ({ cpu, io, sectors, enhanced, ready }: DrivesProps) => {
|
||||||
side,
|
side,
|
||||||
}));
|
}));
|
||||||
},
|
},
|
||||||
dirty: () => {/* Unused */}
|
dirty: () => {/* Unused */ }
|
||||||
};
|
};
|
||||||
|
|
||||||
if (cpu && io) {
|
if (cpu && io) {
|
||||||
|
|
|
@ -51,8 +51,7 @@ export const FileModal = ({ disk2, number, onClose, isOpen }: FileModalProps) =>
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
spawn(async () => {
|
spawn(async () => {
|
||||||
try {
|
try {
|
||||||
const indexRequest = fetch('json/disks/index.json');
|
const indexResponse = await fetch('json/disks/index.json');
|
||||||
const indexResponse = await indexRequest;
|
|
||||||
const index = await indexResponse.json() as IndexEntry[];
|
const index = await indexResponse.json() as IndexEntry[];
|
||||||
setIndex(index);
|
setIndex(index);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
@ -125,7 +124,7 @@ export const FileModal = ({ disk2, number, onClose, isOpen }: FileModalProps) =>
|
||||||
);
|
);
|
||||||
const categoryNames = Object.keys(categories).sort();
|
const categoryNames = Object.keys(categories).sort();
|
||||||
|
|
||||||
const disks = category ? categories[category] : [];
|
const disks = category ? categories[category].sort() : [];
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user