diff --git a/packages/nylas-dashboard/public/js/app.jsx b/packages/nylas-dashboard/public/js/app.jsx index 292075214..2ffa54034 100644 --- a/packages/nylas-dashboard/public/js/app.jsx +++ b/packages/nylas-dashboard/public/js/app.jsx @@ -41,7 +41,10 @@ class Account extends React.Component { } shouldComponentUpdate(nextProps) { - return nextProps.account.version !== this.props.account.version; + return nextProps.account.version !== this.props.account.version || + nextProps.active !== this.props.account.active || + nextProps.assignment !== this.props.assignment || + nextProps.count !== this.props.count; } clearError() { diff --git a/packages/nylas-dashboard/routes/websocket.js b/packages/nylas-dashboard/routes/websocket.js index 41b38af51..ffadf3dce 100644 --- a/packages/nylas-dashboard/routes/websocket.js +++ b/packages/nylas-dashboard/routes/websocket.js @@ -90,12 +90,20 @@ function onWebsocketConnectedFake(wss, ws) { last_sync_completions: [], created_at: "2016-07-13T00:49:25.000Z", }; - ws.send(JSON.stringify({ cmd: "ACCOUNT", payload: acct })); + ws.send(JSON.stringify({ cmd: "UPDATE", payload: { + updatedAccounts: [acct], + activeAccountIds: [], + assignments: {}, + }})); accts.push(acct); } setInterval(() => { const acct = accts[Math.floor(Math.random() * accts.length)]; - ws.send(JSON.stringify({ cmd: "ACCOUNT", payload: acct })); + ws.send(JSON.stringify({ cmd: "UPDATE", payload: { + updatedAccounts: [acct], + activeAccountIds: [], + assignments: {}, + }})); }, 250); }