diff --git a/packages/snjs/lib/Services/ComponentManager/UseCase/GetFeatureUrl.ts b/packages/snjs/lib/Services/ComponentManager/UseCase/GetFeatureUrl.ts index 2d55eca4a..a0b184a1b 100644 --- a/packages/snjs/lib/Services/ComponentManager/UseCase/GetFeatureUrl.ts +++ b/packages/snjs/lib/Services/ComponentManager/UseCase/GetFeatureUrl.ts @@ -20,7 +20,10 @@ export class GetFeatureUrl { } if (uiFeature.isFeatureDescription) { - return this.urlForNativeComponent(uiFeature.asFeatureDescription) + return this.urlForNativeComponent( + uiFeature.asFeatureDescription.identifier, + uiFeature.asFeatureDescription.index_path, + ) } if (uiFeature.asComponent.offlineOnly) { @@ -29,6 +32,13 @@ export class GetFeatureUrl { const url = uiFeature.asComponent.hosted_url || uiFeature.asComponent.legacy_url if (!url) { + if (uiFeature.asComponent.package_info.identifier && uiFeature.asComponent.package_info.index_path) { + return this.urlForNativeComponent( + uiFeature.asComponent.package_info.identifier, + uiFeature.asComponent.package_info.index_path, + ) + } + return undefined } @@ -58,13 +68,16 @@ export class GetFeatureUrl { } } - private urlForNativeComponent(feature: ComponentFeatureDescription): string { + private urlForNativeComponent( + identifier: ComponentFeatureDescription['identifier'], + index_path: ComponentFeatureDescription['index_path'], + ): string { if (this.isMobile) { const baseUrlRequiredForThemesInsideEditors = window.location.href.split('/index.html')[0] - return `${baseUrlRequiredForThemesInsideEditors}/web-src/components/assets/${feature.identifier}/${feature.index_path}` + return `${baseUrlRequiredForThemesInsideEditors}/web-src/components/assets/${identifier}/${index_path}` } else { const baseUrlRequiredForThemesInsideEditors = window.location.origin - return `${baseUrlRequiredForThemesInsideEditors}/components/assets/${feature.identifier}/${feature.index_path}` + return `${baseUrlRequiredForThemesInsideEditors}/components/assets/${identifier}/${index_path}` } } diff --git a/packages/web/package.json b/packages/web/package.json index e224a9b37..7c6599ad0 100644 --- a/packages/web/package.json +++ b/packages/web/package.json @@ -3,7 +3,7 @@ "version": "3.166.14", "license": "AGPL-3.0-or-later", "main": "dist/app.js", - "author": "Standard Notes.", + "author": "Standard Notes", "private": true, "files": [ "dist"