mirror of
https://github.com/bitwarden/browser
synced 2026-01-03 00:53:23 +00:00
* [PM-17541] Switch folder key definition back to "folders" and add migration script for users that have switched to the incorrect key * [PM-17541] Fix import path * [PM-17541] Fix implicit any in spec file
24 lines
724 B
TypeScript
24 lines
724 B
TypeScript
import { Jsonify } from "type-fest";
|
|
|
|
import { FOLDER_DISK, FOLDER_MEMORY, UserKeyDefinition } from "../../../platform/state";
|
|
import { FolderData } from "../../models/data/folder.data";
|
|
import { FolderView } from "../../models/view/folder.view";
|
|
|
|
export const FOLDER_ENCRYPTED_FOLDERS = UserKeyDefinition.record<FolderData>(
|
|
FOLDER_DISK,
|
|
"folders",
|
|
{
|
|
deserializer: (obj: Jsonify<FolderData>) => FolderData.fromJSON(obj),
|
|
clearOn: ["logout"],
|
|
},
|
|
);
|
|
|
|
export const FOLDER_DECRYPTED_FOLDERS = new UserKeyDefinition<FolderView[]>(
|
|
FOLDER_MEMORY,
|
|
"decryptedFolders",
|
|
{
|
|
deserializer: (obj: Jsonify<FolderView[]>) => obj?.map((f) => FolderView.fromJSON(f)) ?? [],
|
|
clearOn: ["logout", "lock"],
|
|
},
|
|
);
|