1
0
mirror of https://github.com/bitwarden/browser synced 2026-02-06 03:33:30 +00:00

clear selection after bulk delete, move, or restore

This commit is contained in:
jaasen-livefront
2025-07-24 12:01:17 -07:00
parent c37965174b
commit 73697c996f
2 changed files with 9 additions and 0 deletions

View File

@@ -217,6 +217,10 @@ export class VaultItemsComponent<C extends CipherViewLike> {
return this.showBulkAddToCollections && this.ciphers.length > 0;
}
clearSelection() {
this.selection.clear();
}
protected canEditCollection(collection: CollectionView): boolean {
// Only allow allow deletion if collection editing is enabled and not deleting "Unassigned"
if (collection.id === Unassigned) {

View File

@@ -108,6 +108,7 @@ import {
} from "../components/vault-item-dialog/vault-item-dialog.component";
import { VaultItem } from "../components/vault-items/vault-item";
import { VaultItemEvent } from "../components/vault-items/vault-item-event";
import { VaultItemsComponent } from "../components/vault-items/vault-items.component";
import { VaultItemsModule } from "../components/vault-items/vault-items.module";
import {
@@ -156,6 +157,7 @@ const SearchTextDebounceInterval = 200;
})
export class VaultComponent<C extends CipherViewLike> implements OnInit, OnDestroy {
@ViewChild("vaultFilter", { static: true }) filterComponent: VaultFilterComponent;
@ViewChild(VaultItemsComponent) vaultItemsComponent: VaultItemsComponent<C>;
trashCleanupWarning: string = null;
kdfIterations: number;
@@ -1070,6 +1072,7 @@ export class VaultComponent<C extends CipherViewLike> implements OnInit, OnDestr
message: this.i18nService.t("restoredItems"),
});
this.refresh();
this.vaultItemsComponent?.clearSelection();
}
private async handleDeleteEvent(items: VaultItem<C>[]) {
@@ -1162,6 +1165,7 @@ export class VaultComponent<C extends CipherViewLike> implements OnInit, OnDestr
const result = await lastValueFrom(dialog.closed);
if (result === BulkDeleteDialogResult.Deleted) {
this.vaultItemsComponent?.clearSelection();
this.refresh();
}
}
@@ -1187,6 +1191,7 @@ export class VaultComponent<C extends CipherViewLike> implements OnInit, OnDestr
const result = await lastValueFrom(dialog.closed);
if (result === BulkMoveDialogResult.Moved) {
this.vaultItemsComponent?.clearSelection();
this.refresh();
}
}