diff --git a/frontend/src/windows/main/pages/Misc.svelte b/frontend/src/windows/main/pages/Misc.svelte
index 9f557d1..ff67b16 100644
--- a/frontend/src/windows/main/pages/Misc.svelte
+++ b/frontend/src/windows/main/pages/Misc.svelte
@@ -121,6 +121,7 @@
switch (id) {
case "redirect_console":
if (state) {
+ console.log(state)
enableConsoleRedirection();
} else {
disableConsoleRedirection();
diff --git a/frontend/src/windows/main/pages/Settings/Panel.svelte b/frontend/src/windows/main/pages/Settings/Panel.svelte
index 55f1081..0e4cdf9 100644
--- a/frontend/src/windows/main/pages/Settings/Panel.svelte
+++ b/frontend/src/windows/main/pages/Settings/Panel.svelte
@@ -100,7 +100,7 @@
{:else if inter.options.type === "boolean"}
{
- dispatch("switchClicked",{id: inter.id, state: sections[section.id][inter.id]})
+ dispatch("switchClicked",{id: inter.id, state: !sections[section.id][inter.id]})
}} />
{:else if inter.options.type === "string"}
{
- return `${await os.getPath("data")}/AppleBlox/config`;
+ return path.join(await os.getPath("data"),"AppleBlox","config")
}
/** Copies the settings folder to Application Support */
@@ -23,28 +24,31 @@ export async function dataPath(): Promise {
// }
/** Saves the data provided to the Application Support folder */
-let saveQueue: {path: string,data:string}[] = []
+let saveQueue: {[key: string]: string} = {}
let hasInterval = false;
if (!hasInterval) {
+ hasInterval = true
setInterval(()=>{
- for (const file of saveQueue) {
- filesystem.writeFile(file.path,file.data).catch(console.error)
+ for (const [path,data] of Object.entries(saveQueue)) {
+ filesystem.writeFile(path,data).catch(console.error);
+ delete saveQueue[path]
}
},1000)
}
export async function saveSettings(panelId: string, data: Object): Promise {
try {
- const path = await dataPath();
- if (!(await pathExists(path))) {
- await filesystem.createDirectory(path);
+ const savePath = (await dataPath());
+ // const savePath = path.join(await os.getPath("downloads"),"aaa")
+ if (!(await pathExists(savePath))) {
+ await filesystem.createDirectory(savePath);
}
try {
- const filepath = `${path}/${panelId}.json`;
- if (await pathExists(filepath)) {
- await filesystem.remove(filepath);
- }
- saveQueue.push({path: `${path}/${panelId}.json`, data: JSON.stringify(data)});
+ // const filepath = `${savePath}/${panelId}.json`;
+ // if (await pathExists(filepath)) {
+ // await filesystem.remove(filepath);
+ // }
+ saveQueue[`${savePath}/${panelId}.json`] = JSON.stringify(data);
} catch (err) {
console.error(err);
}