1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00
jellyfin-web/src/scripts/autoThemes.js

18 lines
754 B
JavaScript
Raw Normal View History

2020-08-14 08:46:34 +02:00
import * as userSettings from './settings/userSettings';
import * as webSettings from './settings/webSettings';
import skinManager from './themeManager';
import { Events } from 'jellyfin-apiclient';
import ServerConnections from '../components/ServerConnections';
// Set the default theme when loading
2020-09-26 21:48:22 +03:00
skinManager.setTheme(userSettings.theme())
/* this keeps the scrollbar always present in all pages, so we avoid clipping while switching between pages
2020-09-26 21:48:22 +03:00
that need the scrollbar and pages that don't.
*/
.then(() => document.body.classList.add('force-scroll'));
2020-10-25 20:20:06 +09:00
// set the saved theme once a user authenticates
Events.on(ServerConnections, 'localusersignedin', function (e, user) {
skinManager.setTheme(userSettings.theme());
});