From e939da1b93c9d3c0744e81edecd7ca96a3899090 Mon Sep 17 00:00:00 2001 From: FMaz Date: Fri, 4 Oct 2024 16:50:56 -0300 Subject: [PATCH] Fixed zero ETV items appearing without proper formatting when using regular notifications --- page/notifications.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/page/notifications.js b/page/notifications.js index bd9b438..eac11c8 100644 --- a/page/notifications.js +++ b/page/notifications.js @@ -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); }; @@ -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