mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-10-27 07:52:24 +00:00
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 <[email protected]>
This commit is contained in:
1 parent
c539fef553
commit
12ba9f07e6
1 file changed
+11
-13
@@ -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) {
|
||||
|
||||
Reference in new issue
Block a user