Add comment to explain sync_state dispatch
This commit is contained in:
parent
fffe425730
commit
8fc44a9b66
1 changed files with 5 additions and 0 deletions
|
@ -895,6 +895,11 @@ module.exports = React.createClass({
|
||||||
});
|
});
|
||||||
|
|
||||||
cli.on('sync', function(state, prevState) {
|
cli.on('sync', function(state, prevState) {
|
||||||
|
// LifecycleStore and others cannot directly subscribe to matrix client for
|
||||||
|
// events because flux only allows store state changes during flux dispatches.
|
||||||
|
// So dispatch directly from here. Ideally we'd use a SyncStateStore that
|
||||||
|
// would do this dispatch and expose the sync state itself (by listening to
|
||||||
|
// its own dispatch).
|
||||||
dis.dispatch({action: 'sync_state', prevState, state});
|
dis.dispatch({action: 'sync_state', prevState, state});
|
||||||
self.updateStatusIndicator(state, prevState);
|
self.updateStatusIndicator(state, prevState);
|
||||||
if (state === "SYNCING" && prevState === "SYNCING") {
|
if (state === "SYNCING" && prevState === "SYNCING") {
|
||||||
|
|
Loading…
Reference in a new issue