From f4db3a4d513ae2240abfcd5d81499689275bded7 Mon Sep 17 00:00:00 2001 From: Stefan Malzner Date: Fri, 10 Nov 2017 22:58:52 +0100 Subject: fix issue with unnecessary settings request invalidation --- src/stores/SettingsStore.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/stores/SettingsStore.js') diff --git a/src/stores/SettingsStore.js b/src/stores/SettingsStore.js index 331df5c15..7cd7c9114 100644 --- a/src/stores/SettingsStore.js +++ b/src/stores/SettingsStore.js @@ -35,7 +35,10 @@ export default class SettingsStore extends Store { @action async _update({ settings }) { await this.updateSettingsRequest.execute(settings)._promise; - await this.allSettingsRequest.invalidate({ immediately: true }); + this.allSettingsRequest.patch((result) => { + if (!result) return; + Object.assign(result, settings); + }); this._shareSettingsWithMainProcess(); -- cgit v1.2.3-54-g00ecf From c3eced0aee03004af82cd840b0e9e5d65c9557af Mon Sep 17 00:00:00 2001 From: Stefan Malzner Date: Fri, 10 Nov 2017 23:13:46 +0100 Subject: fix issue with share settings with main process --- src/stores/SettingsStore.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/stores/SettingsStore.js') diff --git a/src/stores/SettingsStore.js b/src/stores/SettingsStore.js index 7cd7c9114..c301eaf82 100644 --- a/src/stores/SettingsStore.js +++ b/src/stores/SettingsStore.js @@ -40,7 +40,8 @@ export default class SettingsStore extends Store { Object.assign(result, settings); }); - this._shareSettingsWithMainProcess(); + // We need a little hack to wait until everything is patched + setTimeout(() => this._shareSettingsWithMainProcess(), 0); gaEvent('Settings', 'update'); } @@ -54,6 +55,7 @@ export default class SettingsStore extends Store { // Reactions _shareSettingsWithMainProcess() { + console.log(this.all); ipcRenderer.send('settings', this.all); } } -- cgit v1.2.3-54-g00ecf From 9f0e306d2e9ea2f25d05fc6db130cb47d17d1222 Mon Sep 17 00:00:00 2001 From: Stefan Malzner Date: Sun, 12 Nov 2017 21:58:53 +0100 Subject: remove console logging --- src/stores/SettingsStore.js | 1 - 1 file changed, 1 deletion(-) (limited to 'src/stores/SettingsStore.js') diff --git a/src/stores/SettingsStore.js b/src/stores/SettingsStore.js index c301eaf82..ad3c53ccf 100644 --- a/src/stores/SettingsStore.js +++ b/src/stores/SettingsStore.js @@ -55,7 +55,6 @@ export default class SettingsStore extends Store { // Reactions _shareSettingsWithMainProcess() { - console.log(this.all); ipcRenderer.send('settings', this.all); } } -- cgit v1.2.3-54-g00ecf