diff --git a/app/tray/AccountSelector/AccountController/index.js b/app/tray/AccountSelector/AccountController/index.js index d1e7a8800..2832b5f85 100644 --- a/app/tray/AccountSelector/AccountController/index.js +++ b/app/tray/AccountSelector/AccountController/index.js @@ -421,12 +421,6 @@ class Account extends React.Component { const account = this.store('main.accounts', id) const isAddAccountView = this.store('view.addAccount') - if (!account) { - // TODO: why is this rendering if the account is gone? - console.warn('no account!') - return - } - const current = selectedAccountId === id && status === 'ok' const selectedAccountOpen = current && open diff --git a/main/windows/index.ts b/main/windows/index.ts index 513e43198..dc6797708 100644 --- a/main/windows/index.ts +++ b/main/windows/index.ts @@ -539,11 +539,7 @@ const broadcast = (channel: string, ...args: string[]) => { } store.api.feed((_state, actions) => { - actions.forEach((action) => { - action.updates.forEach((update) => { - broadcast('main:action', 'pathSync', update.path, update.value) - }) - }) + broadcast('main:action', 'stateSync', JSON.stringify(actions)) }) export default { diff --git a/resources/store/actions.panel.js b/resources/store/actions.panel.js index 5f075ea75..f35a89aa8 100644 --- a/resources/store/actions.panel.js +++ b/resources/store/actions.panel.js @@ -11,7 +11,18 @@ module.exports = { return Object.assign(module, update) }) }, - pathSync: (u, path, value) => u(path, () => value), + stateSync: (u, _actions) => { + try { + const actions = JSON.parse(_actions) + actions.forEach((action) => { + action.updates.forEach((update) => { + u(update.path, () => update.value) + }) + }) + } catch (e) { + console.error('State Syncing Error', e) + } + }, syncPanel: (u, panel) => u('panel', () => panel), setSigner: (u, signer) => { u('selected.current', () => signer.id)