Skip to content

Commit a0ba012

Browse files
committed
Reimplemented and fixed Dark Mode and Section States to keep them across the whole session (multiple tabs), only to be resetted when the whole window is closed.
1 parent 2988476 commit a0ba012

File tree

3 files changed

+2
-6
lines changed

3 files changed

+2
-6
lines changed

WebApplication2/Customer/Pages/CustomerComponent.aspx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -700,11 +700,6 @@
700700
}
701701
});
702702
703-
// Clear localStorage on window close
704-
window.addEventListener("beforeunload", function () {
705-
localStorage.clear();
706-
});
707-
708703
// Sortable Table Functionality
709704
document.addEventListener('DOMContentLoaded', function () {
710705
document.querySelectorAll('.styled-table th').forEach(function (th) {
@@ -742,7 +737,6 @@
742737
743738
function logout() {
744739
// Clear the session variable
745-
localStorage.removeItem('activeSection');
746740
localStorage.clear();
747741
// Send a POST request to the logout endpoint
748742
fetch('logout.aspx', { method: 'POST' })

WebApplication2/Customer/Pages/login.aspx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@
189189
190190
// Show the pop-up when the page loads
191191
window.onload = function () {
192+
localStorage.clear();
192193
// Check if the user is visiting for the first time in this session
193194
if (!sessionStorage.getItem('closedCustomerLogin')) {
194195
showPopup();

WebApplication2/Pages/Login/Login.aspx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@
178178
179179
// Show the pop-up when the page loads
180180
window.onload = function () {
181+
localStorage.clear();
181182
// Check if the user is visiting for the first time in this session
182183
if (!sessionStorage.getItem('closedAdmin')) {
183184
showPopup();

0 commit comments

Comments
 (0)