[SM-340] Fix share modal not closing on cancel (#4041)

This commit is contained in:
Oscar Hinton 2022-11-11 15:43:19 +01:00 committed by GitHub
parent b96ae86de2
commit d3321ebe1c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 2 deletions

View File

@ -72,7 +72,7 @@
aria-hidden="true"
></i>
</button>
<button type="button" data-dismiss="modal">{{ "cancel" | i18n }}</button>
<button type="button" (click)="close()">{{ "cancel" | i18n }}</button>
</div>
</ng-container>
</form>

View File

@ -1,5 +1,6 @@
import { Component } from "@angular/core";
import { ModalRef } from "@bitwarden/angular/components/modal/modal.ref";
import { ShareComponent as BaseShareComponent } from "@bitwarden/angular/components/share.component";
import { CipherService } from "@bitwarden/common/abstractions/cipher.service";
import { CollectionService } from "@bitwarden/common/abstractions/collection.service";
@ -19,7 +20,8 @@ export class ShareComponent extends BaseShareComponent {
collectionService: CollectionService,
platformUtilsService: PlatformUtilsService,
logService: LogService,
organizationService: OrganizationService
organizationService: OrganizationService,
private modalRef: ModalRef
) {
super(
collectionService,
@ -30,4 +32,8 @@ export class ShareComponent extends BaseShareComponent {
organizationService
);
}
protected close() {
this.modalRef.close();
}
}