fix: distinguish client controlled features so that server expiration timestamps are ignored (#2022)

This commit is contained in:
Mo
2022-11-17 08:42:37 -06:00
committed by GitHub
parent 33b25d4b7a
commit a6e57e30cf
5 changed files with 97 additions and 36 deletions

View File

@@ -153,21 +153,24 @@ export class ThemeManager extends AbstractService {
private handleFeaturesUpdated(): void {
let hasChange = false
for (const themeUuid of this.activeThemes) {
const theme = this.application.items.findItem(themeUuid) as SNTheme
if (!theme) {
this.deactivateTheme(themeUuid)
hasChange = true
} else {
const status = this.application.features.getFeatureStatus(theme.identifier)
if (status !== FeatureStatus.Entitled) {
if (theme.active) {
this.application.mutator.toggleTheme(theme).catch(console.error)
} else {
this.deactivateTheme(theme.uuid)
}
hasChange = true
continue
}
const status = this.application.features.getFeatureStatus(theme.identifier)
if (status !== FeatureStatus.Entitled) {
if (theme.active) {
this.application.mutator.toggleTheme(theme).catch(console.error)
} else {
this.deactivateTheme(theme.uuid)
}
hasChange = true
}
}