diff --git a/baseTemplate/templates/baseTemplate/index.html b/baseTemplate/templates/baseTemplate/index.html index 940fc8fa8..bef27a093 100644 --- a/baseTemplate/templates/baseTemplate/index.html +++ b/baseTemplate/templates/baseTemplate/index.html @@ -2440,12 +2440,13 @@ // .htaccess Feature Notification Functions function checkHtaccessStatus() { // Check if user has dismissed the notification permanently (localStorage for longer persistence) - if (localStorage.getItem('htaccessNotificationDismissed') === 'true') { - return; - } + try { + if (localStorage.getItem('htaccessNotificationDismissed') === 'true') return; + } catch (e) { return; } // Check if notification has been shown today - const lastShown = localStorage.getItem('htaccessNotificationLastShown'); + var lastShown; + try { lastShown = localStorage.getItem('htaccessNotificationLastShown'); } catch (e) { return; } const today = new Date().toDateString(); if (lastShown === today) { @@ -2454,7 +2455,7 @@ // Show the notification showHtaccessNotification(); - localStorage.setItem('htaccessNotificationLastShown', today); + try { localStorage.setItem('htaccessNotificationLastShown', today); } catch (e) {} } function showHtaccessNotification() { @@ -2470,7 +2471,7 @@ banner.classList.remove('show'); body.classList.remove('htaccess-shown'); // Remember dismissal permanently - localStorage.setItem('htaccessNotificationDismissed', 'true'); + try { localStorage.setItem('htaccessNotificationDismissed', 'true'); } catch (e) {} } function isNotificationDismissed(notificationKey) { @@ -2481,7 +2482,7 @@ return {% if ai_scanner_notification_dismissed %}true{% else %}false{% endif %}; } if (notificationKey === 'htaccess-notification') { - return localStorage.getItem('htaccessNotificationDismissed') === 'true'; + try { return localStorage.getItem('htaccessNotificationDismissed') === 'true'; } catch (e) { return false; } } return false; } @@ -2604,10 +2605,12 @@