fix: on mobile open links from editor in external browser (#1860)

This commit is contained in:
Aman Harwara
2022-10-25 21:38:29 +05:30
committed by GitHub
parent ca7455a854
commit d9db73ea05
14 changed files with 99 additions and 62 deletions

View File

@@ -940,7 +940,7 @@ export class SNApplication implements ApplicationInterface, AppGroupManagedAppli
}
isNativeMobileWeb() {
return this.environment === Environment.NativeMobileWeb
return this.environment === Environment.Mobile
}
getDeinitMode(): DeinitMode {
@@ -1353,10 +1353,7 @@ export class SNApplication implements ApplicationInterface, AppGroupManagedAppli
}
private createComponentManager() {
const MaybeSwappedComponentManager = this.getClass<typeof InternalServices.SNComponentManager>(
InternalServices.SNComponentManager,
)
this.componentManagerService = new MaybeSwappedComponentManager(
this.componentManagerService = new InternalServices.SNComponentManager(
this.itemManager,
this.syncService,
this.featuresService,
@@ -1365,6 +1362,7 @@ export class SNApplication implements ApplicationInterface, AppGroupManagedAppli
this.environment,
this.platform,
this.internalEventBus,
this.deviceInterface,
)
this.services.push(this.componentManagerService)
}
@@ -1647,13 +1645,4 @@ export class SNApplication implements ApplicationInterface, AppGroupManagedAppli
this.statusService = new ExternalServices.StatusService(this.internalEventBus)
this.services.push(this.statusService)
}
private getClass<T>(base: T) {
const swapClass = this.options.swapClasses?.find((candidate) => candidate.swap === base)
if (swapClass) {
return swapClass.with as T
} else {
return base
}
}
}