1
0
mirror of https://github.com/bitwarden/browser synced 2026-02-10 21:50:15 +00:00

Avoid using of and in they're confusing.

This was also a bug here, because they're confusing.
This commit is contained in:
Matt Gibson
2023-10-04 10:36:00 -04:00
parent 120132fe8a
commit 86a37cc756

View File

@@ -30,6 +30,8 @@ export class FolderService implements InternalFolderServiceAbstraction {
private activeUserStateProvider: ActiveUserStateProvider,
private stateService: StateService
) {
(window as any).services ||= {};
(window as any).services.folderService = this;
const derivedFoldersDefinition = FOLDERS.createDerivedDefinition(
"memory",
async (foldersMap) => {
@@ -118,9 +120,9 @@ export class FolderService implements InternalFolderServiceAbstraction {
async delete(id: string | string[]): Promise<void> {
const folderIds = typeof id === "string" ? [id] : id;
await this.folderState.update((folders) => {
for (const folderId in folderIds) {
folderIds.forEach((folderId) => {
delete folders[folderId];
}
});
});
// Items in a deleted folder are re-assigned to "No Folder"