From e734f9ca79cc5381426f881ca835ee109e52a69b Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Sun, 8 Feb 2026 01:26:43 +0000 Subject: [PATCH] fix: restore _initNostr and fix syntax error in app.js - Restored missing `_initNostr` method in `js/app.js` which was causing `SyntaxError: Unexpected token '.'` and `nostrClient.init is not a function` errors. - Removed dangling code block that was causing the syntax error (orphaned `accessControl.refresh()...` block). - This fixes unit tests (e.g. `tests/app/channel-profile-moderation.test.mjs`) and application initialization. Co-authored-by: PR0M3TH3AN <53631862+PR0M3TH3AN@users.noreply.github.com> --- js/app.js | 36 ++---------------------------------- 1 file changed, 2 insertions(+), 34 deletions(-) diff --git a/js/app.js b/js/app.js index 335fd813..aef6d9f9 100644 --- a/js/app.js +++ b/js/app.js @@ -1079,41 +1079,9 @@ class Application { } } - accessControl - .refresh() - .then(() => { - if ( - accessControl.lastError && - accessControl.lastError?.code === "nostr-unavailable" - ) { - devLogger.warn( - "[app.init()] Access control refresh should not run before nostrClient.init()", - accessControl.lastError - ); - } - }) - .catch((error) => { - devLogger.warn( - "[app.init()] Failed to process session actor change:", - error, - ); - }); - }); - } - - if (this.profileController) { - Promise.resolve() - .then(() => this.profileController.refreshAdminPaneState()) - .catch((error) => { - devLogger.warn( - "Failed to update admin pane after connecting to Nostr:", - error - ); - }); - } - + async _initNostr() { // Kick off relay connection in the background. - nostrClient.init().catch((err) => { + return nostrClient.init().catch((err) => { devLogger.warn("[app.init()] Background nostrClient.init failed:", err); }); }