chore: feature status in context of item (#2359)

This commit is contained in:
Mo
2023-07-14 11:32:28 -05:00
committed by GitHub
parent 1c8d2f4fb9
commit 1c7a215519
7 changed files with 106 additions and 101 deletions

View File

@@ -16,6 +16,7 @@ import {
PayloadEmitSource,
ComponentInterface,
ThemeInterface,
DecryptedItemInterface,
} from '@standardnotes/models'
import {
AbstractService,
@@ -389,7 +390,10 @@ export class SNFeaturesService
return indexOfRoleToCheck <= highestUserRoleIndex
}
public getFeatureStatus(featureId: FeatureIdentifier): FeatureStatus {
public getFeatureStatus(
featureId: FeatureIdentifier,
options: { inContextOfItem?: DecryptedItemInterface } = {},
): FeatureStatus {
return this.getFeatureStatusUseCase.execute({
featureId,
firstPartyRoles: this.hasFirstPartyOnlineSubscription()
@@ -401,6 +405,7 @@ export class SNFeaturesService
firstPartyOnlineSubscription: this.hasFirstPartyOnlineSubscription()
? this.subscriptions.getOnlineSubscription()
: undefined,
inContextOfItem: options.inContextOfItem,
})
}