fix(web): fix tdb response checking in js

This commit is contained in:
2023-02-17 23:51:45 +03:00
parent 880d4df453
commit c9b921becf
9 changed files with 53 additions and 49 deletions
+9 -9
View File
@@ -9,11 +9,11 @@ $(document).on("click", "#btn-save", function (e) {
return;
}
let resp = tdb_query(db_name, 4);
if (resp.status) {
alert("Successfully saved!");
} else {
if (resp == null || !resp.status) {
alert("Something went wrong!");
return;
}
alert("Successfully saved!");
});
$(document).on("click", "#btn-reload", function (e) {
@@ -25,12 +25,12 @@ $(document).on("click", "#btn-reload", function (e) {
return;
}
let resp = tdb_query(db_name, 2);
if (resp.status) {
localStorage["sasahyou_mts"] = sasahyou_mts = 0;
localStorage["sappyou_mts"] = sappyou_mts = 0;
localStorage["shoppyou_mts"] = shoppyou_mts = 0;
alert("Successfully reloaded database!");
} else {
if (resp == null || !resp.status) {
alert("Something went wrong!");
return;
}
localStorage["sasahyou_mts"] = sasahyou_mts = 0;
localStorage["sappyou_mts"] = sappyou_mts = 0;
localStorage["shoppyou_mts"] = shoppyou_mts = 0;
alert("Successfully reloaded database!");
});