fix: activate cached themes without entitlement check
This commit is contained in:
@@ -160,7 +160,7 @@ export class ThemeManager extends ApplicationService {
|
||||
private async activateCachedThemes() {
|
||||
const cachedThemes = await this.getCachedThemes();
|
||||
for (const theme of cachedThemes) {
|
||||
this.activateTheme(theme);
|
||||
this.activateTheme(theme, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -202,22 +202,26 @@ export class ThemeManager extends ApplicationService {
|
||||
}
|
||||
}
|
||||
|
||||
private activateTheme(theme: SNTheme) {
|
||||
private activateTheme(theme: SNTheme, skipEntitlementCheck = false) {
|
||||
if (this.activeThemes.find((uuid) => uuid === theme.uuid)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (
|
||||
!skipEntitlementCheck &&
|
||||
this.application.getFeatureStatus(theme.identifier) !==
|
||||
FeatureStatus.Entitled
|
||||
FeatureStatus.Entitled
|
||||
) {
|
||||
return;
|
||||
}
|
||||
this.activeThemes.push(theme.uuid);
|
||||
|
||||
const url = this.application.componentManager.urlForComponent(theme);
|
||||
if (!url) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.activeThemes.push(theme.uuid);
|
||||
|
||||
const link = document.createElement('link');
|
||||
link.href = url;
|
||||
link.type = 'text/css';
|
||||
|
||||
Reference in New Issue
Block a user