From 79aa105d58214459c71693904eb8fb81831ba556 Mon Sep 17 00:00:00 2001 From: Sergey Slipchenko Date: Thu, 6 Apr 2023 16:41:13 +0400 Subject: [PATCH] Properly unsubscribe after receiving a pong --- src/ipc/ipc.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/ipc/ipc.ts b/src/ipc/ipc.ts index 4670805f9..b2b2f6b12 100644 --- a/src/ipc/ipc.ts +++ b/src/ipc/ipc.ts @@ -153,11 +153,9 @@ export function createIpcCallProxy>( pipe( responseSource, - subscribe(response => { - if (response !== 'KEEPER_PONG') { - return; - } - + filter(response => response === 'KEEPER_PONG'), + take(1), + subscribe(() => { clearTimeout(retryTimeout); resolve(); })