From 14e57e371468cdbade38aabca2f99e9064ed6d20 Mon Sep 17 00:00:00 2001 From: Ozzie Isaacs Date: Sat, 30 Nov 2024 10:01:03 +0100 Subject: [PATCH] Fix save invalid database --- cps/static/js/main.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/cps/static/js/main.js b/cps/static/js/main.js index a29382e2..9994b450 100644 --- a/cps/static/js/main.js +++ b/cps/static/js/main.js @@ -726,20 +726,20 @@ $(function() { url: getPath() + "/ajax/simulatedbchange", data: {config_calibre_dir: $("#config_calibre_dir").val(), csrf_token: $("input[name='csrf_token']").val()}, success: function success(data) { - if ( data.change ) { - if ( data.valid ) { + if ( !data.valid ) { + $("#InvalidDialog").modal('show'); + } + else{ + if ( data.change ) { confirmDialog( "db_submit", "GeneralChangeModal", 0, changeDbSettings ); - } - else { - $("#InvalidDialog").modal('show'); - } - } else { + } else { changeDbSettings(); + } } } });