From fc4887ef2effabeaa297731b6c6cbf7011370fc7 Mon Sep 17 00:00:00 2001 From: Masahiko AMANO Date: Wed, 15 Feb 2023 21:35:06 +0300 Subject: [PATCH] fix(web): fix TFM database buttons behavior --- web/public/js/tfm-database.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/web/public/js/tfm-database.js b/web/public/js/tfm-database.js index e9d6091..48dcf2f 100644 --- a/web/public/js/tfm-database.js +++ b/web/public/js/tfm-database.js @@ -5,6 +5,9 @@ if (db_name == null) { $(document).on("click", "#btn-save", function (e) { e.preventDefault(); + if (db_name == null) { + return; + } let resp = tdb_query(db_name, 4); if (resp.status) { alert("Successfully saved!"); @@ -15,6 +18,9 @@ $(document).on("click", "#btn-save", function (e) { $(document).on("click", "#btn-reload", function (e) { e.preventDefault(); + if (db_name == null) { + return; + } if (!confirm("All unsaved changes will be lost permanently. Are you sure?")) { return; }