migrate contentService

This commit is contained in:
Denys Vuika
2023-05-18 20:11:53 +01:00
parent b8ec2b88a4
commit f46008830e
3 changed files with 6 additions and 6 deletions

View File

@@ -15,7 +15,7 @@
}, },
"plugins": { "plugins": {
"aosPlugin": "${APP_CONFIG_PLUGIN_AOS}", "aosPlugin": "${APP_CONFIG_PLUGIN_AOS}",
"contentService": ${APP_CONFIG_PLUGIN_CONTENT_SERVICE}, "contentService": "${APP_CONFIG_PLUGIN_CONTENT_SERVICE}",
"folderRules": ${APP_CONFIG_PLUGIN_FOLDER_RULES} "folderRules": ${APP_CONFIG_PLUGIN_FOLDER_RULES}
}, },
"oauth2": { "oauth2": {

View File

@@ -42,7 +42,7 @@ describe('ContentServiceExtensionService', () => {
appConfig = TestBed.inject(AppConfigService); appConfig = TestBed.inject(AppConfigService);
appConfig.config = Object.assign(appConfig.config, { appConfig.config = Object.assign(appConfig.config, {
plugins: { plugins: {
contentService: true contentService: 'true'
} }
}); });

View File

@@ -36,10 +36,10 @@ export class ContentServiceExtensionService {
updateContentServiceAvailability() { updateContentServiceAvailability() {
this.appConfigService.onLoad.pipe(take(1)).subscribe((config) => { this.appConfigService.onLoad.pipe(take(1)).subscribe((config) => {
if (config.plugins && config.plugins.contentService === false) { if (config?.plugins?.contentService === 'true') {
this.disableContentServices();
} else {
this.enableContentServices(); this.enableContentServices();
} else {
this.disableContentServices();
} }
}); });
} }
@@ -51,7 +51,7 @@ export class ContentServiceExtensionService {
} }
private enableContentServices() { private enableContentServices() {
if (localStorage && localStorage.getItem('contentService') === 'false') { if (localStorage) {
localStorage.setItem('contentService', 'true'); localStorage.setItem('contentService', 'true');
} }
} }