From cb546fb8d5f341a1cad0ff3f29540b4480eb27bd Mon Sep 17 00:00:00 2001 From: Stefan Malzner Date: Tue, 3 Apr 2018 19:46:10 +0200 Subject: Fix reintroduced mobx issue with non-existing keys --- 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 82fc2a279..d1327899c 100644 --- a/src/stores/SettingsStore.js +++ b/src/stores/SettingsStore.js @@ -20,7 +20,9 @@ export default class SettingsStore extends Store { this.actions.settings.remove.listen(this._remove.bind(this)); } - setup() { + async setup() { + // We need to wait until `appSettingsRequest` has been executed once, otherwise we can't patch the result. If we don't wait we'd run into an issue with mobx not reacting to changes of previously not existing keys + await this.appSettingsRequest._promise; this._migrate(); } -- cgit v1.2.3-70-g09d2