From 68ba25886a55a85c057051990e065ad4796787fc Mon Sep 17 00:00:00 2001 From: jude Date: Fri, 11 Aug 2023 13:19:31 +0100 Subject: [PATCH] Correct javascript comparisons --- web/static/js/main.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/web/static/js/main.js b/web/static/js/main.js index b920860..b79ce7d 100644 --- a/web/static/js/main.js +++ b/web/static/js/main.js @@ -319,16 +319,16 @@ async function serialize_reminder(node, mode) { const embed_title = node.querySelector('textarea[name="embed_title"]').value; if ( - content.length == 0 && - embed_author.length == 0 && - embed_title.length == 0 && - embed_description.length == 0 && - embed_footer.length == 0 && + content.length === 0 && + embed_author.length === 0 && + embed_title.length === 0 && + embed_description.length === 0 && + embed_footer.length === 0 && embed_author_url === null && embed_footer_url === null && embed_image_url === null && embed_thumbnail_url === null && - fields.length == 0 && + fields.length === 0 && attachment === null ) { return { error: "Reminder needs content." }; @@ -1052,7 +1052,7 @@ document.addEventListener("click", (ev) => { if (ev.target.closest("button.inline-btn") !== null) { let inlined = ev.target.closest(".embed-field-box").dataset["inlined"]; ev.target.closest(".embed-field-box").dataset["inlined"] = - inlined == "1" ? "0" : "1"; + inlined === "1" ? "0" : "1"; } });