File tree Expand file tree Collapse file tree 2 files changed +11
-4
lines changed Expand file tree Collapse file tree 2 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -52,11 +52,8 @@ NAVIGATION_SIDEBAR_HIDDEN=false
5252
5353# Limit items rows on emojiboard.
5454FAV_EMOJI_ROWS_LIMIT = 50
55-
5655RECENT_EMOJI_ROWS_LIMIT = 3
57-
5856FAV_STICKER_ROWS_LIMIT = 3
59-
6057RECENT_STICKER_ROWS_LIMIT = 50
6158
6259# ## Homeserver list
Original file line number Diff line number Diff line change @@ -115,6 +115,7 @@ class Settings extends EventEmitter {
115115 } ,
116116 ) ;
117117
118+ this . systemIsDark = null ;
118119 this . useSystemTheme = this . getUseSystemTheme ( ) ;
119120 this . isMarkdown = this . getIsMarkdown ( ) ;
120121 this . isPeopleDrawer = this . getIsPeopleDrawer ( ) ;
@@ -128,6 +129,13 @@ class Settings extends EventEmitter {
128129 'ontouchstart' in window || navigator . maxTouchPoints > 0 || navigator . msMaxTouchPoints > 0 ;
129130 }
130131
132+ getSystemTheme ( ) {
133+ return {
134+ enabled : this . useSystemTheme ,
135+ isDark : this . systemIsDark ,
136+ } ;
137+ }
138+
131139 getThemeIndex ( ) {
132140 if ( typeof this . themeIndex === 'number' ) return this . themeIndex ;
133141
@@ -246,10 +254,12 @@ class Settings extends EventEmitter {
246254 body . addClass ( 'discord-style' ) ;
247255 }
248256
257+ this . systemIsDark =
258+ window . matchMedia && window . matchMedia ( '(prefers-color-scheme: dark)' ) . matches ;
249259 if ( useSystemTheme ) {
250260 body . addClass ( 'system-theme' ) ;
251261
252- if ( window . matchMedia && window . matchMedia ( '(prefers-color-scheme: dark)' ) . matches ) {
262+ if ( this . systemIsDark ) {
253263 body . addClass ( this . defaultSystemThemeType . dark ) ;
254264 } else {
255265 body . addClass ( this . defaultSystemThemeType . light ) ;
You can’t perform that action at this time.
0 commit comments