Skip to content

Commit 95289c6

Browse files
committed
Fix theme selection for updated layout
1 parent 4e781b0 commit 95289c6

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/scripts/content/nebula/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff 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
};

0 commit comments

Comments
 (0)