diff --git a/apps/web/src/app/admin-console/organizations/collections/vault.component.ts b/apps/web/src/app/admin-console/organizations/collections/vault.component.ts index 9c2293889e3..1956498322b 100644 --- a/apps/web/src/app/admin-console/organizations/collections/vault.component.ts +++ b/apps/web/src/app/admin-console/organizations/collections/vault.component.ts @@ -1138,10 +1138,11 @@ export class VaultComponent implements OnInit, OnDestroy { message: this.i18nService.t("deletedCollectionId", collection.name), }); + // Clear the cipher cache to clear the deleted collection from the cipher state + await this.cipherService.clear(); + // Navigate away if we deleted the collection we were viewing if (this.selectedCollection?.node.id === collection.id) { - // Clear the cipher cache to clear the deleted collection from the cipher state - await this.cipherService.clear(); void this.router.navigate([], { queryParams: { collectionId: this.selectedCollection.parent?.node.id ?? null }, queryParamsHandling: "merge",