2 * Marks all conversations as read.
5 * @copyright 2001-2022 WoltLab GmbH
6 * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
9 define(["require", "exports", "tslib", "WoltLabSuite/Core/Ajax", "WoltLabSuite/Core/Ui/Notification"], function (require
, exports
, tslib_1
, Ajax_1
, UiNotification
) {
11 Object
.defineProperty(exports
, "__esModule", { value
: true });
12 exports
.setup
= void 0;
13 UiNotification
= tslib_1
.__importStar(UiNotification
);
14 async
function markAllAsRead() {
15 await (0, Ajax_1
.dboAction
)("markAllAsRead", "wcf\\data\\conversation\\ConversationAction").dispatch();
16 document
.querySelectorAll(".conversationList .new").forEach((el
) => {
17 el
.classList
.remove("new");
19 document
.querySelector("#unreadConversations .badgeUpdate")?.remove();
20 UiNotification
.show();
23 document
.querySelectorAll(".markAllAsReadButton").forEach((el
) => {
24 el
.addEventListener("click", (event
) => {
25 event
.preventDefault();
30 exports
.setup
= setup
;