Fix settings

This commit is contained in:
1ilit 2024-01-29 09:53:05 +02:00
parent 6f262185d0
commit e35ee8270c

View File

@ -1108,27 +1108,33 @@ export default function ControlPanel({
}, },
}, },
Settings: { Settings: {
Autosave: () => Autosave: {
setSettings((prev) => { function: () =>
Toast.success( setSettings((prev) => {
`Autosave is ${settings.autosave ? "off" : "on"}` Toast.success(
); `Autosave is ${settings.autosave ? "off" : "on"}`
return { ...prev, autosave: !prev.autosave }; );
}), return { ...prev, autosave: !prev.autosave };
Panning: () => }),
setSettings((prev) => { },
Toast.success(`Panning is ${settings.panning ? "off" : "on"}`); Panning: {
return { ...prev, panning: !prev.panning }; function: () =>
}), setSettings((prev) => {
"Flush storage": async () => { Toast.success(`Panning is ${settings.panning ? "off" : "on"}`);
db.delete() return { ...prev, panning: !prev.panning };
.then(() => { }),
Toast.success("Storage flushed"); },
window.location.reload(false); "Flush storage": {
}) function: async () => {
.catch(() => { db.delete()
Toast.error("Oops! Something went wrong."); .then(() => {
}); Toast.success("Storage flushed");
window.location.reload(false);
})
.catch(() => {
Toast.error("Oops! Something went wrong.");
});
},
}, },
}, },
Help: { Help: {
@ -1471,7 +1477,7 @@ export default function ControlPanel({
relationship.endY = endY; relationship.endY = endY;
relationships.push(relationship); relationships.push(relationship);
}); });
relationships.forEach((r, i) => r.id = i); relationships.forEach((r, i) => r.id = i);
if (data.overwrite) { if (data.overwrite) {