2020-08-02 17:28:25 +09:00
|
|
|
import * as userSettings from 'userSettings';
|
|
|
|
import skinManager from 'skinManager';
|
|
|
|
import events from 'events';
|
|
|
|
|
2020-08-09 13:24:16 +02:00
|
|
|
// 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'));
|
2020-08-09 13:24:16 +02:00
|
|
|
|
|
|
|
// 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) {
|
2020-08-02 17:28:25 +09:00
|
|
|
skinManager.setTheme(userSettings.theme());
|
|
|
|
});
|