[FIX] Start loop searching for rooms updates only when connection goes down and SDK has userId (#613)
This commit is contained in:
parent
833bf1e706
commit
c9bf599bcf
|
@ -16,23 +16,21 @@ export default async function subscribeRooms() {
|
||||||
timer = setTimeout(() => {
|
timer = setTimeout(() => {
|
||||||
clearTimeout(timer);
|
clearTimeout(timer);
|
||||||
timer = false;
|
timer = false;
|
||||||
if (this.sdk.userId) {
|
|
||||||
store.dispatch(roomsRequest());
|
store.dispatch(roomsRequest());
|
||||||
loop();
|
loop();
|
||||||
}
|
|
||||||
}, 5000);
|
}, 5000);
|
||||||
};
|
};
|
||||||
|
|
||||||
this.sdk.onStreamData('connected', () => {
|
this.sdk.onStreamData('connected', () => {
|
||||||
if (this.sdk.userId) {
|
|
||||||
store.dispatch(roomsRequest());
|
store.dispatch(roomsRequest());
|
||||||
}
|
|
||||||
clearTimeout(timer);
|
clearTimeout(timer);
|
||||||
timer = false;
|
timer = false;
|
||||||
});
|
});
|
||||||
|
|
||||||
this.sdk.onStreamData('close', () => {
|
this.sdk.onStreamData('close', () => {
|
||||||
|
if (this.sdk.userId) {
|
||||||
loop();
|
loop();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
this.sdk.onStreamData('stream-notify-user', protectedFunction((ddpMessage) => {
|
this.sdk.onStreamData('stream-notify-user', protectedFunction((ddpMessage) => {
|
||||||
|
|
Loading…
Reference in New Issue