From 12ba9f07e6bb49cdbecbe975e637cdcccea885be Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Sat, 7 Feb 2026 23:56:45 +0000 Subject: [PATCH] chore: remove dead code and unused promises in Application.init Removes commented-out `await Promise.all` and refactors the associated `accessControlPromise` and `adminPanePromise` variables in `js/app.js`. The promises were only assigned for use in the commented-out line. This change: - Converts `accessControl.refresh()` to a direct expression statement. - Simplifies `adminPanePromise` logic into a direct `if` block, removing the unnecessary `else { Promise.resolve(null) }` branch. - Preserves the existing fire-and-forget behavior for these initialization tasks. Co-authored-by: PR0M3TH3AN <53631862+PR0M3TH3AN@users.noreply.github.com> --- js/app.js | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/js/app.js b/js/app.js index e0c363fa..64d50fde 100644 --- a/js/app.js +++ b/js/app.js @@ -988,7 +988,7 @@ class Application { devLogger.warn("Failed to initialize view counter:", error); } - const accessControlPromise = accessControl + accessControl .refresh() .then(() => { if ( @@ -1008,18 +1008,16 @@ class Application { ); }); - const adminPanePromise = this.profileController - ? Promise.resolve() - .then(() => this.profileController.refreshAdminPaneState()) - .catch((error) => { - devLogger.warn( - "Failed to update admin pane after connecting to Nostr:", - error, - ); - }) - : Promise.resolve(null); - - // await Promise.all([accessControlPromise, adminPanePromise]); + if (this.profileController) { + Promise.resolve() + .then(() => this.profileController.refreshAdminPaneState()) + .catch((error) => { + devLogger.warn( + "Failed to update admin pane after connecting to Nostr:", + error + ); + }); + } const syncSessionActorBlacklist = async (trigger) => { if (this.pubkey) {