chore: fix native feature check
This commit is contained in:
@@ -24,10 +24,6 @@ export class UIFeature<F extends UIFeatureDescriptionTypes> implements UIFeature
|
|||||||
return isItemBasedFeature(this.item)
|
return isItemBasedFeature(this.item)
|
||||||
}
|
}
|
||||||
|
|
||||||
get isFeatureDescription(): boolean {
|
|
||||||
return isNativeFeature(this.item)
|
|
||||||
}
|
|
||||||
|
|
||||||
get isThemeComponent(): boolean {
|
get isThemeComponent(): boolean {
|
||||||
return isItemBasedFeature(this.item) && isTheme(this.item)
|
return isItemBasedFeature(this.item) && isTheme(this.item)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ import { Uuid } from '@standardnotes/domain-core'
|
|||||||
export interface UIFeatureInterface<F extends UIFeatureDescriptionTypes> {
|
export interface UIFeatureInterface<F extends UIFeatureDescriptionTypes> {
|
||||||
item: ComponentInterface | F
|
item: ComponentInterface | F
|
||||||
get isComponent(): boolean
|
get isComponent(): boolean
|
||||||
get isFeatureDescription(): boolean
|
|
||||||
get isThemeComponent(): boolean
|
get isThemeComponent(): boolean
|
||||||
get asComponent(): ComponentInterface
|
get asComponent(): ComponentInterface
|
||||||
get asFeatureDescription(): F
|
get asFeatureDescription(): F
|
||||||
|
|||||||
@@ -19,10 +19,10 @@ export class GetFeatureUrl {
|
|||||||
return this.urlForFeatureOnDesktop(uiFeature)
|
return this.urlForFeatureOnDesktop(uiFeature)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (uiFeature.isFeatureDescription) {
|
if (uiFeature.isNativeFeature) {
|
||||||
return this.urlForNativeComponent(
|
return this.urlForNativeComponent(
|
||||||
uiFeature.asFeatureDescription.identifier,
|
uiFeature.featureDescription.identifier,
|
||||||
uiFeature.asFeatureDescription.index_path,
|
uiFeature.featureDescription.index_path,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -55,9 +55,9 @@ export class GetFeatureUrl {
|
|||||||
throw new Error('Desktop manager is not defined')
|
throw new Error('Desktop manager is not defined')
|
||||||
}
|
}
|
||||||
|
|
||||||
if (uiFeature.isFeatureDescription) {
|
if (uiFeature.isNativeFeature) {
|
||||||
return `${this.desktopManager.getExtServerHost()}/components/${uiFeature.featureIdentifier}/${
|
return `${this.desktopManager.getExtServerHost()}/components/${uiFeature.featureIdentifier}/${
|
||||||
uiFeature.asFeatureDescription.index_path
|
uiFeature.featureDescription.index_path
|
||||||
}`
|
}`
|
||||||
} else {
|
} else {
|
||||||
if (uiFeature.asComponent.local_url) {
|
if (uiFeature.asComponent.local_url) {
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ export class RunWithPermissionsUseCase {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if (uiFeature.isFeatureDescription) {
|
if (uiFeature.isNativeFeature) {
|
||||||
runFunction()
|
runFunction()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user