niksos/modules/gui/vesktop/readonlyFix.patch

18 lines
629 B
Diff
Raw Normal View History

2024-01-20 01:22:09 +01:00
diff --git a/src/main/settings.ts b/src/main/settings.ts
index 6fad97f..dfc64e3 100644
--- a/src/main/settings.ts
+++ b/src/main/settings.ts
@@ -26,8 +26,10 @@ function loadSettings<T extends object = any>(file: string, name: string) {
const store = new SettingsStore(settings);
store.addGlobalChangeListener(o => {
- mkdirSync(dirname(file), { recursive: true });
- writeFileSync(file, JSON.stringify(o, null, 4));
+ try {
+ mkdirSync(dirname(file), { recursive: true });
+ writeFileSync(file, JSON.stringify(o, null, 4));
+ } catch {}
});
return store;