fix: timed color scheme toast (#978)

This commit is contained in:
Aman Harwara
2022-04-15 22:39:49 +05:30
committed by GitHub
parent 9dafdeeddb
commit a9bab0938b
3 changed files with 8 additions and 10 deletions

View File

@@ -176,6 +176,7 @@ export class ThemeManager extends ApplicationService {
const themes = this.application.items.getDisplayableItems(ContentType.Theme) as SNTheme[]
const activeTheme = themes.find((theme) => theme.active && !theme.isLayerable())
const activeThemeIdentifier = activeTheme ? activeTheme.identifier : DefaultThemeIdentifier
const themeIdentifier = this.application.getPreference(
preference,
@@ -193,12 +194,9 @@ export class ThemeManager extends ApplicationService {
}
}
const isPreferredThemeNotActive = activeTheme?.identifier !== themeIdentifier
const isPreferredThemeNotActive = activeThemeIdentifier !== themeIdentifier
const isDefaultThemePreferredAndNotActive =
themeIdentifier === DefaultThemeIdentifier && activeTheme
if (isPreferredThemeNotActive && isDefaultThemePreferredAndNotActive) {
if (isPreferredThemeNotActive) {
this.showColorSchemeToast(setTheme)
}
}