From 54de942e7f009d58f33abd26deb3c0697c9acd22 Mon Sep 17 00:00:00 2001 From: Yuri Kuznetsov Date: Wed, 14 Feb 2024 11:17:14 +0200 Subject: [PATCH] modal clear on close --- client/src/views/modal.js | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/client/src/views/modal.js b/client/src/views/modal.js index d03aaf435e..18bc06561c 100644 --- a/client/src/views/modal.js +++ b/client/src/views/modal.js @@ -569,15 +569,14 @@ class ModalView extends View { */ actionCancel() { this.trigger('cancel'); - this.dialog.close(); + this.close(); } /** * A `close` action. */ actionClose() { - this.trigger('cancel'); - this.dialog.close(); + this.actionCancel(); } /** @@ -585,6 +584,16 @@ class ModalView extends View { */ close() { this.dialog.close(); + + if (!this.getParentView()) { + return; + } + + const key = this.getParentView().getViewKey(this); + + if (key) { + this.getParentView().clearView(key); + } } /**