modal: handle premature close calls

Signed-off-by: Varun Patil <radialapps@gmail.com>
pull/900/head
Varun Patil 2023-10-30 12:49:52 -07:00
parent bf6127493e
commit 32e910561d
1 changed files with 7 additions and 1 deletions

View File

@ -83,7 +83,13 @@ export default defineComponent({
methods: { methods: {
close() { close() {
(<any>this.$refs.modal).close(); const modal: any = this.$refs.modal;
if (modal?.close) {
modal.close();
} else {
// Premature calls, before the modal is mounted
this.cleanup();
}
}, },
cleanup() { cleanup() {