Skip to content

Commit 09155b3

Browse files
committed
Reload rows after mark all as read
1 parent dfb40aa commit 09155b3

2 files changed

Lines changed: 10 additions & 22 deletions

File tree

ts/WoltLabSuite/Core/Ui/Moderation/MarkAllAsRead.ts

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,26 +7,20 @@
77
* @since 6.0
88
*/
99

10+
import { showDefaultSuccessSnackbar } from "WoltLabSuite/Core/Component/Snackbar";
1011
import { dboAction } from "../../Ajax";
11-
import * as UiNotification from "../Notification";
1212

1313
async function markAllAsRead(): Promise<void> {
1414
await dboAction("markAllAsRead", "wcf\\data\\moderation\\queue\\ModerationQueueAction").dispatch();
1515

16-
document
17-
.querySelectorAll("#wcf-system-gridView-user-ModerationQueueGridView_table .newMessageBadge")
18-
.forEach((el: HTMLElement) => {
19-
el.remove();
20-
});
21-
document.querySelector("#outstandingModeration .badgeUpdate")?.remove();
16+
const gridViewTable = document.getElementById("wcf-system-gridView-user-ModerationQueueGridView_table")!;
17+
gridViewTable.dispatchEvent(new CustomEvent("interaction:invalidate-all"));
2218

23-
UiNotification.show();
19+
showDefaultSuccessSnackbar();
2420
}
2521

2622
export function setup(): void {
27-
document.querySelector<HTMLButtonElement>(".markAllAsReadButton")?.addEventListener("click", (event) => {
28-
event.preventDefault();
29-
23+
document.querySelector<HTMLButtonElement>(".markAllAsReadButton")?.addEventListener("click", () => {
3024
void markAllAsRead();
3125
});
3226
}

wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Moderation/MarkAllAsRead.js

Lines changed: 5 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)