diff --git a/apps/web/src/app/billing/shared/update-license-dialog.component.ts b/apps/web/src/app/billing/shared/update-license-dialog.component.ts index 7338bb7aa6..5f9a1e94be 100644 --- a/apps/web/src/app/billing/shared/update-license-dialog.component.ts +++ b/apps/web/src/app/billing/shared/update-license-dialog.component.ts @@ -1,4 +1,3 @@ -import { DialogRef } from "@angular/cdk/dialog"; import { Component } from "@angular/core"; import { FormBuilder } from "@angular/forms"; @@ -24,16 +23,8 @@ export class UpdateLicenseDialogComponent extends UpdateLicenseComponent { platformUtilsService: PlatformUtilsService, organizationApiService: OrganizationApiServiceAbstraction, formBuilder: FormBuilder, - dialogRef: DialogRef, // Add this line ) { - super( - apiService, - i18nService, - platformUtilsService, - organizationApiService, - formBuilder, - dialogRef, - ); + super(apiService, i18nService, platformUtilsService, organizationApiService, formBuilder); } async submitLicense() { await this.submit(); diff --git a/apps/web/src/app/billing/shared/update-license.component.ts b/apps/web/src/app/billing/shared/update-license.component.ts index 14ee8df680..30b5983090 100644 --- a/apps/web/src/app/billing/shared/update-license.component.ts +++ b/apps/web/src/app/billing/shared/update-license.component.ts @@ -1,4 +1,3 @@ -import { DialogRef } from "@angular/cdk/dialog"; import { Component, EventEmitter, Input, Output } from "@angular/core"; import { FormBuilder, Validators } from "@angular/forms"; @@ -7,7 +6,6 @@ import { OrganizationApiServiceAbstraction } from "@bitwarden/common/admin-conso import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service"; import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service"; -import { UpdateLicenseDialogResult } from "./update-license-dialog.component"; @Component({ selector: "app-update-license", templateUrl: "update-license.component.html", @@ -30,7 +28,6 @@ export class UpdateLicenseComponent { private platformUtilsService: PlatformUtilsService, private organizationApiService: OrganizationApiServiceAbstraction, private formBuilder: FormBuilder, - private dialogRef: DialogRef, ) {} protected setSelectedFile(event: Event) { const fileInputEl = event.target; @@ -54,25 +51,24 @@ export class UpdateLicenseComponent { const fd = new FormData(); fd.append("license", files); - // let updatePromise: Promise = null; - // if (this.organizationId == null) { - // updatePromise = this.apiService.postAccountLicense(fd); - // } else { - // updatePromise = this.organizationApiService.updateLicense(this.organizationId, fd); - // } + let updatePromise: Promise = null; + if (this.organizationId == null) { + updatePromise = this.apiService.postAccountLicense(fd); + } else { + updatePromise = this.organizationApiService.updateLicense(this.organizationId, fd); + } - // this.formPromise = updatePromise.then(() => { - // return this.apiService.refreshIdentityToken(); - // }); + this.formPromise = updatePromise.then(() => { + return this.apiService.refreshIdentityToken(); + }); - // await this.formPromise; - // this.platformUtilsService.showToast( - // "success", - // null, - // this.i18nService.t("licenseUploadSuccess"), - // ); - // this.onUpdated.emit(); - this.dialogRef.close(UpdateLicenseDialogResult.Updated); + await this.formPromise; + this.platformUtilsService.showToast( + "success", + null, + this.i18nService.t("licenseUploadSuccess"), + ); + this.onUpdated.emit(); }; cancel = () => {