Created
July 21, 2021 19:30
-
-
Save sourishkrout/5637a08001a00b94d9f05cc740cfd4e2 to your computer and use it in GitHub Desktop.
Two lines 🤯
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -4,6 +4,7 @@ import { interval, merge, Observable, of, Subject, timer } from "rxjs"; | |
import { | |
bufferTime, | |
catchError, | |
+ delayWhen, | |
filter, | |
map, | |
mergeAll, | |
@@ -346,6 +347,9 @@ export class EventManager { | |
this.stateMgr.getExtProps(), | |
this.authMgr.authToken() | |
); | |
+ | |
+ const isConnected$ = wspub.getStatus().pipe(filter((connected) => connected)); | |
+ | |
this._publishers.set("ws", wspub); | |
merge( | |
windowEvent$, | |
@@ -358,6 +362,7 @@ export class EventManager { | |
session$ | |
) | |
.pipe( | |
+ delayWhen((msg: any) => isConnected$), | |
catchError((e) => { | |
console.log(e); | |
this.channel.appendLine(e); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment