Bug 32991: Don't remove all messages when confirm box is closed

If we cancel the confirmation box we should not clear all the messages

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Agustín Moyano <agustinmoyano@theke.io>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 8cee1f287d)
Signed-off-by: Jacob O'Mara <jacob.omara@ptfs-europe.com>
This commit is contained in:
Jonathan Druart 2023-02-28 11:48:55 +01:00 committed by Jacob O'Mara
parent db492707e8
commit 03777e80fc
2 changed files with 12 additions and 6 deletions

View File

@ -21,7 +21,11 @@
<i class="fa fa-fw fa-check"></i>
<span v-html="confirmation.accept_label"></span>
</button>
<button id="close_modal" class="deny" @click="removeMessages">
<button
id="close_modal"
class="deny"
@click="removeConfirmationMessages"
>
<i class="fa fa-fw fa-remove"></i>
<span v-html="confirmation.cancel_label"></span>
</button>
@ -52,7 +56,7 @@ export default {
is_submitting,
is_loading,
} = storeToRefs(mainStore)
const { removeMessages } = mainStore
const { removeMessages, removeConfirmationMessages } = mainStore
return {
message,
error,
@ -62,6 +66,7 @@ export default {
is_submitting,
is_loading,
removeMessages,
removeConfirmationMessages,
}
},
}

View File

@ -39,12 +39,9 @@ export const useMainStore = defineStore("main", {
if(accept_callback) {
this._accept_callback = async () => {
await accept_callback()
this.removeMessages()
this.removeConfirmationMessages()
}
}
this._error = null;
this._warning = null;
this._message = null;
this._confirmation = confirmation;
this.displayed_already = displayed; /* Is displayed on the current view */
},
@ -58,6 +55,10 @@ export const useMainStore = defineStore("main", {
}
this.displayed_already = true;
},
removeConfirmationMessages(){
this._confirmation = null;
this._accept_callback = null;
},
submitting(){
this._is_submitting = true;
},