File tree Expand file tree Collapse file tree
src/scripts/content/nebula Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -168,8 +168,8 @@ const click = async (e: MouseEvent) => {
168168 if ( target . closest ( '.nebula-watch-later' ) )
169169 return ;
170170
171- if ( target . closest ( 'main [role="listbox"]' ) && location . pathname . startsWith ( '/settings/preferences' ) )
172- return changeTheme ( e ) ;
171+ if ( target . closest ( '#root [role="listbox"]' ) && location . pathname . startsWith ( '/settings/preferences' ) )
172+ return setTimeout ( changeTheme , 0 ) ;
173173
174174 const addAll = target . closest ( '.enhancer-queueButtonAll' ) ;
175175 if ( addAll !== null ) {
@@ -281,8 +281,8 @@ const createLinkForAll = () => {
281281 container . appendChild ( link ) ;
282282} ;
283283
284- const changeTheme = ( e : MouseEvent ) => {
285- const theme = ( e . target as HTMLElement ) . dataset . value . toLowerCase ( ) ;
284+ const changeTheme = ( ) => {
285+ const theme = JSON . parse ( localStorage . getItem ( 'colorSchemeSetting' ) ) ;
286286 console . debug ( 'Saving theme' , theme ) ;
287287 setToStorage ( { theme } ) ;
288288} ;
You can’t perform that action at this time.
0 commit comments