mirror of
https://github.com/Novaloop-AG/healthchat-web.git
synced 2026-11-10 01:01:45 +00:00
Fix issue with dispatch happening mid-dispatch due to js-sdk emit (#8473)
This commit is contained in:
committed by
GitHub
parent
dc9ec8526c
commit
a88112a37a
@@ -282,7 +282,8 @@ function addMatrixClientListener(
|
|||||||
const listener: Listener = (...args) => {
|
const listener: Listener = (...args) => {
|
||||||
const payload = actionCreator(matrixClient, ...args);
|
const payload = actionCreator(matrixClient, ...args);
|
||||||
if (payload) {
|
if (payload) {
|
||||||
dis.dispatch(payload, true);
|
// Consumers shouldn't have to worry about calling js-sdk methods mid-dispatch, so make this dispatch async
|
||||||
|
dis.dispatch(payload, false);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
matrixClient.on(eventName, listener);
|
matrixClient.on(eventName, listener);
|
||||||
|
|||||||
Reference in New Issue
Block a user