mirror of
https://github.com/bitwarden/browser
synced 2025-12-16 16:23:44 +00:00
[PM-5276] Migrate FolderService to state providers (#7682)
* added state definitionand key definition for folder service * added data migrations * created folder to house key definitions * deleted browser-folder-service and added state provider to the browser * exposed decrypt function so it can be used by the key definition, updated folder service to use state provider * removed memory since derived state is now used * updated test cases * updated test cases * updated migrations after merge conflict fix * added state provider to the folder service constructor * renamed migration file * updated comments * updated comments * removed service registartion from browser service module and removed unused set and get encrypted folders from state service * renamed files * added storage location overides and removed extra methods
This commit is contained in:
@@ -27,7 +27,6 @@ import { UserKey, MasterKey, DeviceKey } from "../../types/key";
|
||||
import { UriMatchType } from "../../vault/enums";
|
||||
import { CipherData } from "../../vault/models/data/cipher.data";
|
||||
import { CollectionData } from "../../vault/models/data/collection.data";
|
||||
import { FolderData } from "../../vault/models/data/folder.data";
|
||||
import { LocalData } from "../../vault/models/data/local.data";
|
||||
import { CipherView } from "../../vault/models/view/cipher.view";
|
||||
import { CollectionView } from "../../vault/models/view/collection.view";
|
||||
@@ -1801,27 +1800,6 @@ export class StateService<
|
||||
);
|
||||
}
|
||||
|
||||
@withPrototypeForObjectValues(FolderData)
|
||||
async getEncryptedFolders(options?: StorageOptions): Promise<{ [id: string]: FolderData }> {
|
||||
return (
|
||||
await this.getAccount(this.reconcileOptions(options, await this.defaultOnDiskMemoryOptions()))
|
||||
)?.data?.folders?.encrypted;
|
||||
}
|
||||
|
||||
async setEncryptedFolders(
|
||||
value: { [id: string]: FolderData },
|
||||
options?: StorageOptions,
|
||||
): Promise<void> {
|
||||
const account = await this.getAccount(
|
||||
this.reconcileOptions(options, await this.defaultOnDiskMemoryOptions()),
|
||||
);
|
||||
account.data.folders.encrypted = value;
|
||||
await this.saveAccount(
|
||||
account,
|
||||
this.reconcileOptions(options, await this.defaultOnDiskMemoryOptions()),
|
||||
);
|
||||
}
|
||||
|
||||
@withPrototypeForArrayMembers(GeneratedPasswordHistory)
|
||||
async getEncryptedPasswordGenerationHistory(
|
||||
options?: StorageOptions,
|
||||
|
||||
Reference in New Issue
Block a user