feat: Added "Private vaults" as a Labs feature. Can be enabled from Preferences > General > Labs (#2562)
This commit is contained in:
@@ -130,7 +130,12 @@ export class FeaturesController extends AbstractViewController implements Intern
|
||||
return status === FeatureStatus.Entitled
|
||||
}
|
||||
|
||||
isEntitledToVaults(): boolean {
|
||||
isVaultsEnabled(): boolean {
|
||||
const enabled = this.features.isExperimentalFeatureEnabled(NativeFeatureIdentifier.TYPES.Vaults)
|
||||
return featureTrunkVaultsEnabled() || enabled
|
||||
}
|
||||
|
||||
isEntitledToSharedVaults(): boolean {
|
||||
const status = this.features.getFeatureStatus(
|
||||
NativeFeatureIdentifier.create(NativeFeatureIdentifier.TYPES.SharedVaults).getValue(),
|
||||
)
|
||||
|
||||
@@ -71,7 +71,8 @@ describe('LinkingController', () => {
|
||||
application.getPreference = jest.fn()
|
||||
application.addSingleEventObserver = jest.fn()
|
||||
application.sync.sync = jest.fn()
|
||||
application.featuresController.isEntitledToVaults = jest.fn().mockReturnValue(true)
|
||||
application.featuresController.isVaultsEnabled = jest.fn().mockReturnValue(true)
|
||||
application.featuresController.isEntitledToSharedVaults = jest.fn().mockReturnValue(true)
|
||||
|
||||
Object.defineProperty(application, 'items', { value: {} as jest.Mocked<ItemManagerInterface> })
|
||||
|
||||
|
||||
@@ -208,7 +208,7 @@ export class LinkingController extends AbstractViewController implements Interna
|
||||
const linkNoteAndFile = async (note: SNNote, file: FileItem) => {
|
||||
const updatedFile = await this.mutator.associateFileWithNote(file, note)
|
||||
|
||||
if (this.featuresController.isEntitledToVaults()) {
|
||||
if (this.featuresController.isVaultsEnabled()) {
|
||||
if (updatedFile) {
|
||||
const noteVault = this.vaults.getItemVault(note)
|
||||
const fileVault = this.vaults.getItemVault(updatedFile)
|
||||
|
||||
Reference in New Issue
Block a user