mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2024-09-22 16:26:18 +08:00
hiding delete button if there are rewards to claim
This commit is contained in:
parent
fed91710d6
commit
c7858ef7b2
|
@ -140,10 +140,14 @@ async function getAccountAlerts(): Promise<void> {
|
|||
<div class="buttons">
|
||||
${
|
||||
ie.rewards.length > 0
|
||||
? `<div class="textButton" aria-label="Claim" data-balloon-pos="left"><i class="fas fa-gift"></i></div>`
|
||||
? `<div class="markReadAlert textButton" aria-label="Claim" data-balloon-pos="left"><i class="fas fa-gift"></i></div>`
|
||||
: ``
|
||||
}
|
||||
<div class="textButton" aria-label="Delete" data-balloon-pos="left"><i class="fas fa-trash"></i></div>
|
||||
${
|
||||
ie.rewards.length > 0 && ie.read === false
|
||||
? ``
|
||||
: `<div class="deleteAlert textButton" aria-label="Delete" data-balloon-pos="left"><i class="fas fa-trash"></i></div>`
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -226,6 +230,16 @@ $("#alertsPopupWrapper").on("mousedown", (e) => {
|
|||
}
|
||||
});
|
||||
|
||||
$("#alertsPopup .accountAlerts .list").on(
|
||||
"click",
|
||||
".item .buttons .deleteAlert",
|
||||
(e) => {
|
||||
const id = $(e.currentTarget).closest(".item").attr("data-id") as string;
|
||||
mailToDelete.push(id);
|
||||
$(e.currentTarget).closest(".item").remove();
|
||||
}
|
||||
);
|
||||
|
||||
$(document).on("keydown", (e) => {
|
||||
if (e.key === "Escape" && !$("#alertsPopupWrapper").hasClass("hidden")) {
|
||||
hide();
|
||||
|
|
Loading…
Reference in a new issue