mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-01-11 02:30:21 +08:00
[client-app] re-setup IdentityStore in new window
Summary: Before this patch, the IdentityStore would initialize in our empty hot window. However, hot windows don't receive any `action-bridge-message`s, which include DB updates. Since the hot window loads first, it was with a stale verison of the Identity. The main window fetches a fresh identity, but that fresh update failed to get to new composers because the hot window wasn't listening to changes to the DB. This makes it such that the IdentityStore properly boots up when the window props change. Test Plan: manual Reviewers: halla, juan Reviewed By: juan Differential Revision: https://phab.nylas.com/D4327
This commit is contained in:
parent
368201f334
commit
2f082f8beb
1 changed files with 9 additions and 1 deletions
|
@ -22,6 +22,14 @@ class IdentityStore extends NylasStore {
|
|||
}
|
||||
|
||||
async activate() {
|
||||
if (NylasEnv.isEmptyWindow()) {
|
||||
NylasEnv.onWindowPropsReceived(() => {
|
||||
this.deactivate();
|
||||
this.activate();
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
NylasEnv.config.onDidChange('env', this._onEnvChanged);
|
||||
this._onEnvChanged();
|
||||
|
||||
|
@ -37,7 +45,7 @@ class IdentityStore extends NylasStore {
|
|||
}
|
||||
|
||||
deactivate() {
|
||||
this._disp.dispose();
|
||||
if (this._disp) this._disp.dispose();
|
||||
this.stopListeningToAll()
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue