DmnChzl / ReadWrite

Another note-taking application...
Other
0 stars 0 forks source link

StickyHeader: Persist "darkMode" #6

Open DmnChzl opened 9 months ago

DmnChzl commented 9 months ago
import { onMounted } from 'vue';

onMounted(() => {
  const item = sessionStorage.getItem('_read_write_app');

  if (item) {
    const { theme: themeValue = 'light' } = JSON.parse(item);
    if (themeValue === 'dark') document.documentElement.classList.add('dark');
    // TODO: theme.value = themeValue;
  }
});
DmnChzl commented 9 months ago

bugfix/persist-darkmode