mirror of
https://github.com/StarCitizenTools/mediawiki-skins-Citizen.git
synced 2024-09-23 10:19:43 +00:00
bug: fix changing theme through UPO (#340)
This commit is contained in:
parent
abffe590b5
commit
0e63bb6aef
|
@ -55,12 +55,10 @@ final class Theme extends Partial {
|
|||
$this->out->addHtmlClasses( 'skin-citizen-' . $theme );
|
||||
|
||||
// Add styles and scripts module
|
||||
if ( $theme === 'auto' ) {
|
||||
$options['scripts'] = array_merge(
|
||||
$options['scripts'],
|
||||
[ 'skins.citizen.scripts.theme' ]
|
||||
);
|
||||
}
|
||||
$options['scripts'] = array_merge(
|
||||
$options['scripts'],
|
||||
[ 'skins.citizen.scripts.theme' ]
|
||||
);
|
||||
|
||||
$options['styles'] = array_merge(
|
||||
$options['styles'],
|
||||
|
|
|
@ -22,6 +22,12 @@
|
|||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
if ( window.mw.cookie.get( 'skin-citizen-theme-override' ) === '1' ) {
|
||||
return;
|
||||
}
|
||||
} catch ( e ) {}
|
||||
|
||||
theme = window.mw.config.get( 'wgCitizenThemeDefault' );
|
||||
if ( theme === null ) {
|
||||
theme = 'auto';
|
||||
|
@ -34,15 +40,10 @@
|
|||
}
|
||||
|
||||
if ( theme !== 'auto' ) {
|
||||
setStorageChangeTheme( theme );
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
if ( window.mw.cookie.get( 'skin-citizen-theme-override' ) === '1' ) {
|
||||
return;
|
||||
}
|
||||
} catch ( e ) {}
|
||||
|
||||
prefersColorSchemeDarkQuery = window.matchMedia( '(prefers-color-scheme: dark)' );
|
||||
theme = 'light';
|
||||
if ( prefersColorSchemeDarkQuery.matches ) {
|
||||
|
|
Loading…
Reference in a new issue