chore: show current vault in template note if using exclusive mode

This commit is contained in:
Aman Harwara
2023-09-14 15:25:24 +05:30
parent cac8f4adf5
commit 7b0e4d0edc
3 changed files with 54 additions and 17 deletions

View File

@@ -14,6 +14,7 @@ import {
VaultLockServiceEvent,
} from '@standardnotes/services'
import {
DecryptedItemInterface,
ExclusionaryOptions,
VaultDisplayOptions,
VaultDisplayOptionsPersistable,
@@ -103,6 +104,19 @@ export class VaultDisplayService
return this.options.isInExclusiveDisplayMode()
}
getItemVault(item: DecryptedItemInterface): VaultListingInterface | undefined {
if (this.application.items.isTemplateItem(item)) {
if (this.exclusivelyShownVault) {
return this.exclusivelyShownVault
}
return undefined
}
const vault = this.application.vaults.getItemVault(item)
return vault
}
changeToMultipleVaultDisplayMode(): void {
const vaults = this.application.vaults.getVaults()
const lockedVaults = this.application.vaultLocks.getLockedvaults()

View File

@@ -1,9 +1,11 @@
import { VaultDisplayOptions, VaultListingInterface } from '@standardnotes/models'
import { DecryptedItemInterface, VaultDisplayOptions, VaultListingInterface } from '@standardnotes/models'
import { AbstractUIServiceInterface } from '../Abstract/AbstractUIServiceInterface'
export interface VaultDisplayServiceInterface extends AbstractUIServiceInterface {
exclusivelyShownVault?: VaultListingInterface
getItemVault(item: DecryptedItemInterface): VaultListingInterface | undefined
getOptions(): VaultDisplayOptions
isVaultDisabledOrLocked(vault: VaultListingInterface): boolean