File tree 1 file changed +5
-1
lines changed
1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -289,6 +289,10 @@ function playground_text(playground, hidden = true) {
289
289
var themeToggleButton = document . getElementById ( 'theme-toggle' ) ;
290
290
var themePopup = document . getElementById ( 'theme-list' ) ;
291
291
var themeColorMetaTag = document . querySelector ( 'meta[name="theme-color"]' ) ;
292
+ var themeIds = [ ] ;
293
+ themePopup . querySelectorAll ( 'button.theme' ) . forEach ( function ( el ) {
294
+ themeIds . push ( el . id ) ;
295
+ } ) ;
292
296
var stylesheets = {
293
297
ayuHighlight : document . querySelector ( "[href$='ayu-highlight.css']" ) ,
294
298
tomorrowNight : document . querySelector ( "[href$='tomorrow-night.css']" ) ,
@@ -317,7 +321,7 @@ function playground_text(playground, hidden = true) {
317
321
function get_theme ( ) {
318
322
var theme ;
319
323
try { theme = localStorage . getItem ( 'mdbook-theme' ) ; } catch ( e ) { }
320
- if ( theme === null || theme === undefined ) {
324
+ if ( theme === null || theme === undefined || ! themeIds . includes ( theme ) ) {
321
325
return default_theme ;
322
326
} else {
323
327
return theme ;
You can’t perform that action at this time.
0 commit comments