traxxx/assets/js/ui/state.js

16 lines
534 B
JavaScript
Raw Normal View History

2021-01-03 21:53:51 +00:00
const storedTagFilter = localStorage.getItem('tagFilter');
const storedBatch = localStorage.getItem('batch');
2020-03-23 00:43:49 +00:00
const storedSfw = localStorage.getItem('sfw');
const storedTheme = localStorage.getItem('theme');
const deviceTheme = window.matchMedia?.('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
export default {
2021-01-03 21:53:51 +00:00
tagFilter: storedTagFilter ? storedTagFilter.split(',') : [],
range: 'latest',
batch: storedBatch || 'all',
sfw: storedSfw === 'true' || false,
theme: storedTheme || deviceTheme,
2021-04-22 17:44:23 +00:00
notifications: [],
};