Fix reference to undefined getLocalStorage in navbar

This commit is contained in:
Mark Dumay
2024-09-20 17:25:19 +02:00
parent f936bdd117
commit 2d5225e205

View File

@@ -7,7 +7,10 @@ const colorsBG = ['body', 'secondary', 'tertiary']
function updateNavbar () {
if (window.scrollY > 75) {
navbar.classList.add('nav-active')
const storedTheme = getLocalStorage('theme', null, 'functional')
let storedTheme
if (typeof getLocalStorage === "function") {
storedTheme = getLocalStorage('theme', null, 'functional')
}
if (storedTheme) {
navbar.setAttribute('data-bs-theme', storedTheme)
}