diff --git a/assets/js/main.js b/assets/js/main.js index 9c92789..620db5d 100644 --- a/assets/js/main.js +++ b/assets/js/main.js @@ -21,7 +21,7 @@ jQuery(function($) { _Blog.toggleTheme = function() { const currentTheme = window.localStorage && window.localStorage.getItem('theme') - const isDark = currentTheme === undefined || currentTheme === 'dark' + const isDark = currentTheme === null || currentTheme === 'dark' $('body').toggleClass('dark-theme', isDark) $('.theme-switch').on('click', () => { $('body').toggleClass('dark-theme')