fix: dark mode not working in editors (#1773)
This commit is contained in:
@@ -1,4 +1,7 @@
|
||||
import { ThemeItem } from '@/Components/QuickSettingsMenu/ThemeItem'
|
||||
import { FeatureIdentifier } from '@standardnotes/snjs'
|
||||
|
||||
const isDarkModeTheme = (theme: ThemeItem) => theme.identifier === FeatureIdentifier.DarkTheme
|
||||
|
||||
export const sortThemes = (a: ThemeItem, b: ThemeItem) => {
|
||||
const aIsLayerable = a.component?.isLayerable()
|
||||
@@ -8,6 +11,8 @@ export const sortThemes = (a: ThemeItem, b: ThemeItem) => {
|
||||
return 1
|
||||
} else if (!aIsLayerable && bIsLayerable) {
|
||||
return -1
|
||||
} else if (!isDarkModeTheme(a) && isDarkModeTheme(b)) {
|
||||
return 1
|
||||
} else {
|
||||
return a.name.toLowerCase() < b.name.toLowerCase() ? -1 : 1
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user