feat(mobile): add setting to always open web view on launch (#1500)

This commit is contained in:
Aman Harwara
2022-09-09 13:32:23 +05:30
committed by GitHub
parent e2715709d4
commit 320fc3fd96
8 changed files with 64 additions and 16 deletions

View File

@@ -291,11 +291,15 @@ export class SNComponentManager
}
const isWeb = this.environment === Environment.Web
const isMobileWebView = this.environment === Environment.NativeMobileWeb
if (nativeFeature) {
if (!isWeb) {
if (!isWeb && !isMobileWebView) {
throw Error('Mobile must override urlForComponent to handle native paths')
}
const baseUrlRequiredForThemesInsideEditors = window.location.origin
let baseUrlRequiredForThemesInsideEditors = window.location.origin
if (isMobileWebView) {
baseUrlRequiredForThemesInsideEditors = window.location.href.split('/index.html')[0]
}
return `${baseUrlRequiredForThemesInsideEditors}/components/assets/${component.identifier}/${nativeFeature.index_path}`
}