mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-10-29 17:02:28 +00:00
Fix: Ensure UI refreshes upon trusted seed updates
Subscribes `js/app.js` to `moderationService` events (`trusted-mutes`, `user-blocks`, `summary`). This ensures that asynchronous updates to trusted seed block lists (Kind 10000) trigger an immediate UI refresh, correctly applying moderation (blur/hide) even for anonymous session actors who rely on these seeds. Previously, the initial render would complete before the async lists arrived, leaving blocked content visible until a page reload.
This commit is contained in:
1 parent
966a7810cb
commit
dc476392b2
1 file changed
+12
@@ -2651,6 +2651,18 @@ class Application {
|
||||
* Setup general event listeners for logout, modals, etc.
|
||||
*/
|
||||
setupEventListeners() {
|
||||
if (moderationService && typeof moderationService.on === "function") {
|
||||
moderationService.on("trusted-mutes", () => {
|
||||
this.refreshVisibleModerationUi({ reason: "trusted-mutes" });
|
||||
});
|
||||
moderationService.on("user-blocks", () => {
|
||||
this.refreshVisibleModerationUi({ reason: "user-blocks" });
|
||||
});
|
||||
moderationService.on("summary", () => {
|
||||
this.refreshVisibleModerationUi({ reason: "moderation-summary" });
|
||||
});
|
||||
}
|
||||
|
||||
if (this.appChromeController) {
|
||||
this.appChromeController.initialize();
|
||||
return;
|
||||
|
||||
Reference in new issue
Block a user