Merge pull request #955 from PR0M3TH3AN/codex/fix-community-filters-not-applying-properly

Ensure moderation UI re-applies after grid refresh
This commit is contained in:
thePR0M3TH3AN authored and GitHub committed 2025-10-26 20:54:31 -04:00
commit 7cf773a9b6
1 file changed
+29
+29
View File
@@ -4426,6 +4426,20 @@ class Application {
if (refreshTasks.length) {
await Promise.allSettled(refreshTasks);
}
if (typeof this.refreshVisibleModerationUi === "function") {
const refreshReason =
normalizedReason || (forceMainReload ? "refresh-all-video-grids" : "refresh");
try {
this.refreshVisibleModerationUi({ reason: refreshReason });
} catch (error) {
const contextMessage = refreshReason ? ` after ${refreshReason}` : "";
devLogger.warn(
`[Application] Failed to refresh moderation UI${contextMessage}:`,
error,
);
}
}
}
async onVideosShouldRefresh({ reason } = {}) {
@@ -7157,6 +7171,21 @@ class Application {
: [];
this.videoListView.render(decoratedVideos, metadata);
if (typeof this.refreshVisibleModerationUi === "function") {
const renderReason =
metadata && typeof metadata.reason === "string" && metadata.reason
? `render-${metadata.reason}`
: "render-video-list";
try {
this.refreshVisibleModerationUi({ reason: renderReason });
} catch (error) {
devLogger.warn(
"[Application] Failed to refresh moderation UI after rendering video list:",
error,
);
}
}
this.updateModalSimilarContent();
}