1
0
mirror of https://github.com/bitwarden/browser synced 2026-02-05 11:13:44 +00:00

disable attachment button on desktop vault when the form

This commit is contained in:
Nick Krantz
2025-08-22 12:45:29 -05:00
parent dacbd9dc16
commit fff053efd7
2 changed files with 14 additions and 1 deletions

View File

@@ -35,9 +35,15 @@
(cipherSaved)="savedCipher($event)"
[beforeSubmit]="onSubmit"
[submitBtn]="footer?.submitBtn"
(formStatusChange$)="formStatusChanged($event)"
>
<bit-item slot="attachment-button">
<button bit-item-content type="button" (click)="openAttachmentsDialog()">
<button
bit-item-content
type="button"
(click)="openAttachmentsDialog()"
[disabled]="formDisabled"
>
<p class="tw-m-0">
{{ "attachments" | i18n }}
<span

View File

@@ -163,6 +163,9 @@ export class VaultV2Component<C extends CipherViewLike>
config: CipherFormConfig | null = null;
isSubmitting = false;
/** Tracks the status of the edit cipher form */
protected formDisabled: boolean = false;
private organizations$: Observable<Organization[]> = this.accountService.activeAccount$.pipe(
map((a) => a?.id),
switchMap((id) => this.organizationService.organizations$(id)),
@@ -447,6 +450,10 @@ export class VaultV2Component<C extends CipherViewLike>
);
}
formStatusChanged(status: "disabled" | "enabled") {
this.formDisabled = status === "disabled";
}
async openAttachmentsDialog() {
if (!this.userHasPremiumAccess) {
await this.premiumUpgradePromptService.promptForPremium();