mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-09-22 00:06:06 +08:00
Re-render accounts in more scenarios and update onWebsocketConnectedFake
This commit is contained in:
parent
b03b8b537d
commit
0b9933b514
|
@ -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() {
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue