Guard browser OPFS default machine path helper

This commit is contained in:
2026-06-14 01:12:10 +08:00
parent 1bf920bc27
commit febab4c20e
2 changed files with 55 additions and 6 deletions

View File

@@ -4480,9 +4480,9 @@
function assertMachineTextStorePaths(label, paths, machineId) {
const expectedPaths = {
ini: `linuxcnc/machines/${machineId}/machine.ini`,
toolTable: `linuxcnc/machines/${machineId}/tool.tbl`,
parameters: `linuxcnc/machines/${machineId}/linuxcnc.var`,
ini: opfsMachineFilePath(machineId, "machine.ini"),
toolTable: opfsMachineFilePath(machineId, "tool.tbl"),
parameters: opfsMachineFilePath(machineId, "linuxcnc.var"),
};
for (const [name, expectedPath] of Object.entries(expectedPaths)) {
if (paths[name] !== expectedPath) {
@@ -4591,9 +4591,9 @@
throw new Error(`${label}: unexpected machine id ${session.machineId}`);
}
const expectedOpfsPaths = {
ini: `linuxcnc/machines/${machineId}/machine.ini`,
parameters: `linuxcnc/machines/${machineId}/linuxcnc.var`,
toolTable: `linuxcnc/machines/${machineId}/tool.tbl`,
ini: opfsMachineFilePath(machineId, "machine.ini"),
parameters: opfsMachineFilePath(machineId, "linuxcnc.var"),
toolTable: opfsMachineFilePath(machineId, "tool.tbl"),
...(expectedPaths.opfs ?? {}),
};
assertOpfsIniStaging(