master
Brian Whelan 2024-06-27 08:23:36 +01:00 committed by GitHub
parent beff82a2f9
commit 5f6d49a622
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 15 deletions

View File

@ -61,14 +61,14 @@
function toggleVisibility() { function toggleVisibility() {
let empty = document.getElementById("empty"); let empty = document.getElementById("empty");
let loading = document.getElementById("loading"); let loading = document.getElementById("loading");
if (replies.length == 0) { if (fetching) {
empty.setAttribute("class", "d-block");
loading.setAttribute("class", "d-hide");
}
else if (fetching) {
loading.setAttribute("class", "d-block"); loading.setAttribute("class", "d-block");
empty.setAttribute("class", "d-hide"); empty.setAttribute("class", "d-hide");
} }
else if (replies.length == 0) {
empty.setAttribute("class", "d-block");
loading.setAttribute("class", "d-hide");
}
else { else {
loading.setAttribute("class", "d-hide"); loading.setAttribute("class", "d-hide");
empty.setAttribute("class", "d-hide"); empty.setAttribute("class", "d-hide");
@ -105,7 +105,7 @@
var reply = {}; var reply = {};
reply.text = document.getElementById('msg').value; reply.text = document.getElementById('msg').value;
replies.push(reply); replies.push(reply);
return updateDevice(); updateDevice();
} }
function updateDevice() { function updateDevice() {
@ -114,10 +114,7 @@
Util.writeStorage("replies.json", JSON.stringify(replies), () => { Util.writeStorage("replies.json", JSON.stringify(replies), () => {
fetching = false; fetching = false;
renderReplyList(); renderReplyList();
return true;
}); });
fetching = false;
return false;
} }
</script> </script>
</body> </body>

View File

@ -12,8 +12,6 @@ exports.reply = function (options) {
responseMessage = { t: "notify", id: msg.id, n: "REPLY", msg: replyText }; responseMessage = { t: "notify", id: msg.id, n: "REPLY", msg: replyText };
} }
E.showMenu(); E.showMenu();
layout.setUI();
layout.render();
if (options.sendReply == null || options.sendReply) { if (options.sendReply == null || options.sendReply) {
Bluetooth.println(JSON.stringify(responseMessage)); Bluetooth.println(JSON.stringify(responseMessage));
} }
@ -26,8 +24,6 @@ exports.reply = function (options) {
title: options.title || /*LANG*/ "Reply with:", title: options.title || /*LANG*/ "Reply with:",
back: function () { back: function () {
E.showMenu(); E.showMenu();
layout.setUI();
layout.render();
reject("User pressed back"); reject("User pressed back");
}, },
}, // options }, // options
@ -56,8 +52,6 @@ exports.reply = function (options) {
{ {
buttons: { Ok: true }, buttons: { Ok: true },
remove: function () { remove: function () {
layout.setUI();
layout.render();
reject( reject(
"Please install a keyboard app, or set a custom reply via the app loader!" "Please install a keyboard app, or set a custom reply via the app loader!"
); );