Correct javascript comparisons

This commit is contained in:
jude 2023-08-11 13:19:31 +01:00
parent e25bf6b828
commit 68ba25886a

View File

@ -319,16 +319,16 @@ async function serialize_reminder(node, mode) {
const embed_title = node.querySelector('textarea[name="embed_title"]').value; const embed_title = node.querySelector('textarea[name="embed_title"]').value;
if ( if (
content.length == 0 && content.length === 0 &&
embed_author.length == 0 && embed_author.length === 0 &&
embed_title.length == 0 && embed_title.length === 0 &&
embed_description.length == 0 && embed_description.length === 0 &&
embed_footer.length == 0 && embed_footer.length === 0 &&
embed_author_url === null && embed_author_url === null &&
embed_footer_url === null && embed_footer_url === null &&
embed_image_url === null && embed_image_url === null &&
embed_thumbnail_url === null && embed_thumbnail_url === null &&
fields.length == 0 && fields.length === 0 &&
attachment === null attachment === null
) { ) {
return { error: "Reminder needs content." }; return { error: "Reminder needs content." };
@ -1052,7 +1052,7 @@ document.addEventListener("click", (ev) => {
if (ev.target.closest("button.inline-btn") !== null) { if (ev.target.closest("button.inline-btn") !== null) {
let inlined = ev.target.closest(".embed-field-box").dataset["inlined"]; let inlined = ev.target.closest(".embed-field-box").dataset["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";
} }
}); });