mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2024-09-22 00:06:16 +08:00
swapping to delete all button if all mail is queued to claim
removing delete button if all mail is queued to delete only marking to claim/delete if not already marked
This commit is contained in:
parent
d33413bf23
commit
0738c2d8ea
|
@ -352,7 +352,7 @@ function updateClaimDeleteAllButton(): void {
|
|||
if (accountAlerts.length > 0) {
|
||||
let rewardsCount = 0;
|
||||
for (const ie of accountAlerts) {
|
||||
if (ie.read === false) {
|
||||
if (ie.read === false && !mailToMarkRead.includes(ie.id)) {
|
||||
rewardsCount += ie.rewards.length;
|
||||
}
|
||||
}
|
||||
|
@ -363,17 +363,24 @@ function updateClaimDeleteAllButton(): void {
|
|||
deleteAllButton.removeClass("hidden");
|
||||
}
|
||||
}
|
||||
if (mailToDelete.length === accountAlerts.length) {
|
||||
deleteAllButton.addClass("hidden");
|
||||
}
|
||||
}
|
||||
|
||||
$("#alertsPopup .accountAlerts").on("click", ".claimAll", () => {
|
||||
for (const ie of accountAlerts) {
|
||||
markReadAlert(ie.id);
|
||||
if (ie.read === false && !mailToMarkRead.includes(ie.id)) {
|
||||
markReadAlert(ie.id);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$("#alertsPopup .accountAlerts").on("click", ".deleteAll", () => {
|
||||
for (const ie of accountAlerts) {
|
||||
deleteAlert(ie.id);
|
||||
if (!mailToDelete.includes(ie.id)) {
|
||||
deleteAlert(ie.id);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in a new issue