Skip to content

Commit

Permalink
Fixed zero ETV items appearing without proper formatting when using r…
Browse files Browse the repository at this point in the history
…egular notifications
  • Loading branch information
FMaz008 committed Oct 4, 2024
1 parent 1b6a9f2 commit e939da1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions page/notifications.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ const handleBrendaClick = (e) => {

const asin = e.target.dataset.asin;
const queue = e.target.dataset.queue;
const etv = document.querySelector("#vh-notification-" + asin + " .etv_value").innerText;
let etv = document.querySelector("#vh-notification-" + asin + " .etv_value").innerText;
etv = Number(etv.replace(/[^0-9-.]+/g, ""));
window.BrendaAnnounceQueue.announce(asin, etv, queue);
};

Expand Down Expand Up @@ -289,7 +290,7 @@ function addItem(data) {
Tpl.setVar("img_url", img_url);
Tpl.setVar("queue", queue);
Tpl.setVar("type", type);
Tpl.setVar("etv", formatETV(etv));
Tpl.setVar("etv", ""); //We will let SetETV() handle it.
Tpl.setIf("announce", Settings.get("discord.active") && Settings.get("discord.guid", false) != null);
let content = Tpl.render(loadedTpl, true); //true to return a DOM object instead of an HTML string

Expand Down

0 comments on commit e939da1

Please sign in to comment.