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

View File

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