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

16 lines
611 B
JavaScript
Raw Normal View History

import * as userSettings from 'userSettings';
import skinManager from 'skinManager';
import events from 'events';
// 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
that need the scrollbar and pages that don't.
*/
.then(() => document.body.classList.add('force-scroll'));
// Set the user's prefered theme when signing in
2020-08-30 06:06:47 +02:00
events.on(window.connectionManager, 'localusersignedin', function (e, user) {
skinManager.setTheme(userSettings.theme());
});