mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-10-27 07:52:24 +00:00
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:
1 parent
072be49068
commit
e734f9ca79
1 file changed
+2
-34
@@ -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);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user