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 <[email protected]>
This commit is contained in:
google-labs-jules[bot]andPR0M3TH3AN committed 2026-02-08 01:26:43 +00:00
1 parent 072be49068
commit e734f9ca79
1 file changed
+2 -34
+2 -34
View File
@@ -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);
});
}