From 075519220baf97f76ac462353c6c93e9b5b02ab7 Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Sat, 28 Dec 2024 01:44:59 +0100 Subject: [PATCH] handle_ajax_return(): only display success_message if no other message is provided and fix auto-dismiss it --- static/js/app.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/static/js/app.js b/static/js/app.js index 255742d..ad6adec 100644 --- a/static/js/app.js +++ b/static/js/app.js @@ -182,10 +182,11 @@ function handle_ajax_return( }); if (data && data.success) { - if (success_message) alertify.notify(success_message, "success"); + if (!(data.messages && data.messages.length) && success_message) + alertify.notify(success_message, "success", 5); return true; } - if (!data.errors) + if (!(data.errors && data.errors.length)) alertify.notify( default_error ?? _(