From aded8280be66b954bf66a2922d5dbc0bc096c2fc Mon Sep 17 00:00:00 2001 From: TohnoCoding <98242280+TohnoCoding@users.noreply.github.com> Date: Thu, 14 Nov 2024 21:47:38 -0400 Subject: [PATCH] Making cookie implementation simpler --- js/changelog.js | 3 +++ js/index.js | 4 +--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/js/changelog.js b/js/changelog.js index ccc9ee5..79d5129 100644 --- a/js/changelog.js +++ b/js/changelog.js @@ -25,6 +25,9 @@ function showChangelogModal() { $("#darkener").toggleClass("visible-darkener"); } +/** + * Hides the changelog modal from visibility. + */ function hideChangelogModal() { setCookie(Config.cookieName, true); $('#changelogModal').css('top', '-500%'); diff --git a/js/index.js b/js/index.js index 7e443fe..25e2741 100644 --- a/js/index.js +++ b/js/index.js @@ -38,10 +38,8 @@ $.fn.select2.amd.define('select2/data/customAdapter', $(async function() { await fetchGlobalThreshold(); $('#loadingModal').modal('show'); // Show Loading Modal - var cookie = - (getCookie(Config.cookieName) === "true"); // Changelog cookie check + var cookie = getCookie(Config.cookieName); // Changelog cookie check if(!cookie) { showChangelogModal(); } - else { $("#noticeBoard").css("display", "block"); } // Load File Prepare $("#" + Config.file_hidden_id).on("change", (function() { loadUploadedFileData(); }));