From f20414975dd0950749ffac9435b0559cdca983a6 Mon Sep 17 00:00:00 2001 From: Jon Staab Date: Mon, 6 Jul 2026 11:40:00 -0700 Subject: [PATCH] Whenever our pubkey changes clear connections and reopen --- src/routes/+layout.svelte | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index b5dc0be0..d4386ff5 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -11,7 +11,7 @@ import {page} from "$app/stores" import {sync, throttled} from "@welshman/store" import {always, call} from "@welshman/lib" - import {defaultSocketPolicies, netContext} from "@welshman/net" + import {defaultSocketPolicies, netContext, Pool} from "@welshman/net" import {appContext, pubkey, sessions, signerLog, shouldUnwrap} from "@welshman/app" import {routerContext} from "@welshman/router" import {verifyEvent} from "@welshman/util" @@ -248,6 +248,9 @@ // Initialize background notifications unsubscribers.push(Push.sync()) + // Any time our pubkey changes, close all connections + pubkey.subscribe(() => Pool.get().clear()) + // Listen for signer errors, report to user via toast unsubscribers.push( throttled(10_000, signerLog).subscribe($log => {