Skip to content

Commit a5f55e5

Browse files
migration of session storage data into local storage
1 parent ab26c7e commit a5f55e5

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/frontend/wwwroot/utils.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,18 @@ window.GetAuthDetails = async () => {
7474
// });
7575

7676
window.getStoredData = (key)=> {
77-
return localStorage.getItem(key)
77+
let data = localStorage.getItem(key);
78+
79+
// If not found in localStorage, check sessionStorage
80+
if (!data) {
81+
data = sessionStorage.getItem(key);
82+
if (data) {
83+
// Move data from sessionStorage to localStorage
84+
setStoredData(key, data);
85+
sessionStorage.removeItem(key); // Optional cleanup
86+
}
87+
}
88+
return data;
7889
}
7990

8091
window.setStoredData = (key, value)=> {

0 commit comments

Comments
 (0)