Skip to content

Commit

Permalink
sessionStorage replace with localStorage to keep theme settings after…
Browse files Browse the repository at this point in the history
… browser is closed.
  • Loading branch information
tvrzna committed Sep 12, 2023
1 parent 7b246c5 commit 7c86f79
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions www/static/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ ajsf("lurch-settings", context => {
const themeItemName = "lurch.theme";

context.switchTheme = () => {
var currentTheme = sessionStorage.getItem(themeItemName);
var currentTheme = localStorage.getItem(themeItemName);
context.setTheme(currentTheme == "dark" ? "light" : "dark");
};

Expand All @@ -414,8 +414,8 @@ ajsf("lurch-settings", context => {
} else {
$('body').removeAttr("id");
}
sessionStorage.setItem(themeItemName, theme);
localStorage.setItem(themeItemName, theme);
};

context.setTheme(sessionStorage.getItem(themeItemName));
context.setTheme(localStorage.getItem(themeItemName));
});

0 comments on commit 7c86f79

Please sign in to comment.