Dispatch MatrixActions synchronously

Otherwise we risk blocking the dispatches on other work, and they
do not need to be done asynchronously.

This emerged as a bug where the room list appeared empty until
MatrixActions.sync dispatches all occured in one big lump, well
after the sync events being emitted by the js-sdk.
This commit is contained in:
Luke Barnard 2018-02-08 14:48:29 +00:00
parent 1ea6301eca
commit 21d70125e4

View File

@ -101,7 +101,7 @@ export default {
*/
_addMatrixClientListener(matrixClient, eventName, actionCreator) {
const listener = (...args) => {
dis.dispatch(actionCreator(matrixClient, ...args));
dis.dispatch(actionCreator(matrixClient, ...args), true);
};
matrixClient.on(eventName, listener);
this._matrixClientListenersStop.push(() => {