diff --git a/js/app.js b/js/app.js index f54687b3..a974e8ac 100644 --- a/js/app.js +++ b/js/app.js @@ -3866,7 +3866,10 @@ class Application { } resolveSubscriptionsLink() { - if (this.subscriptionsLink instanceof HTMLElement) { + if ( + this.subscriptionsLink instanceof HTMLElement && + this.subscriptionsLink.isConnected + ) { return this.subscriptionsLink; } diff --git a/js/index.js b/js/index.js index 553d3e60..f74e90b6 100644 --- a/js/index.js +++ b/js/index.js @@ -621,6 +621,12 @@ async function bootstrapInterface() { await loadSidebar("components/sidebar.html", "sidebarContainer"); devLogger.log("Sidebar loaded."); + try { + await applicationReadyPromise; + } catch (error) { + // fall through + } + if (application && typeof application.hydrateSidebarNavigation === "function") { try { application.hydrateSidebarNavigation(); diff --git a/js/nostr/toolkit.js b/js/nostr/toolkit.js index 829be9c8..fd94b10b 100644 --- a/js/nostr/toolkit.js +++ b/js/nostr/toolkit.js @@ -522,7 +522,11 @@ export function shimLegacySimplePoolMethods(pool) { } closed = true; try { - closer?.close?.("closed by caller"); + if (typeof closer === "function") { + closer(); + } else if (closer && typeof closer.close === "function") { + closer.close("closed by caller"); + } } catch (error) { devLogger.warn("[nostr] Failed to close SimplePool subscription.", error); }