fix: Fixed issue with system color scheme not being applied correctly on start
This commit is contained in:
@@ -36,7 +36,7 @@ export interface ComponentManagerInterface {
|
||||
getDefaultEditorIdentifier(currentTag?: SNTag): string
|
||||
|
||||
isThemeActive(theme: UIFeature<ThemeFeatureDescription>): boolean
|
||||
toggleTheme(theme: UIFeature<ThemeFeatureDescription>): Promise<void>
|
||||
toggleTheme(theme: UIFeature<ThemeFeatureDescription>, skipEntitlementCheck?: boolean): Promise<void>
|
||||
getActiveThemes(): UIFeature<ThemeFeatureDescription>[]
|
||||
getActiveThemesIdentifiers(): { features: NativeFeatureIdentifier[]; uuids: Uuid[] }
|
||||
|
||||
|
||||
@@ -390,7 +390,7 @@ export class ComponentManager
|
||||
return this.viewers.find((viewer) => viewer.sessionKey === key)
|
||||
}
|
||||
|
||||
public async toggleTheme(uiFeature: UIFeature<ThemeFeatureDescription>): Promise<void> {
|
||||
public async toggleTheme(uiFeature: UIFeature<ThemeFeatureDescription>, skipEntitlementCheck = false): Promise<void> {
|
||||
this.logger.info('Toggling theme', uiFeature.uniqueIdentifier)
|
||||
|
||||
if (this.isThemeActive(uiFeature)) {
|
||||
@@ -399,7 +399,7 @@ export class ComponentManager
|
||||
}
|
||||
|
||||
const featureStatus = this.features.getFeatureStatus(uiFeature.uniqueIdentifier)
|
||||
if (featureStatus !== FeatureStatus.Entitled) {
|
||||
if (!skipEntitlementCheck && featureStatus !== FeatureStatus.Entitled) {
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
@@ -247,7 +247,7 @@ export class ThemeManager extends AbstractUIService {
|
||||
} else {
|
||||
const theme = themes.find((theme) => theme.featureIdentifier === themeIdentifier)
|
||||
if (theme && !this.components.isThemeActive(theme)) {
|
||||
this.components.toggleTheme(theme).catch(console.error)
|
||||
this.components.toggleTheme(theme, true).catch(console.error)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user