make mobileAppSwitch generic

This commit is contained in:
Denys Vuika
2023-05-19 10:04:31 +01:00
parent 52d4111c7b
commit 140ef552fa

View File

@@ -169,14 +169,19 @@ export class AppService implements OnDestroy {
this.overlayContainer.getContainerElement().setAttribute('role', 'region');
const isMobileSwitchEnabled = this.config.get<string>('mobileAppSwitch.enabled', 'false') === 'true';
if (isMobileSwitchEnabled) {
const isEnabled = this.isMobileSwitchEnabled();
if (isEnabled) {
this.acaMobileAppSwitcherService.resolveExistenceOfDialog();
} else {
this.acaMobileAppSwitcherService.clearSessionExpireTime();
}
}
private isMobileSwitchEnabled(): boolean {
const flag = this.config.get<boolean | string>('mobileAppSwitch.enabled');
return flag === true || flag === 'true';
}
private loadRepositoryStatus() {
this.contentApi.getRepositoryInformation().subscribe((response: DiscoveryEntry) => {
if (response?.entry?.repository) {