From 9d189fb9a23a2a052357677a3179df95806dd261 Mon Sep 17 00:00:00 2001 From: Justin Date: Fri, 7 Jul 2023 17:41:14 +0800 Subject: [PATCH] save custom msg to json file after clicking add --- static/app.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/static/app.js b/static/app.js index 0d830cd..49c15a9 100755 --- a/static/app.js +++ b/static/app.js @@ -1600,8 +1600,8 @@ function getImageSettings(page) { return settings; } +// ADD MSG TO LIST AND SAVE MSG TO JSON FILE var messages = []; - messagesTextAddBtn.addEventListener("click", () => { let pageSelector = "Page13"; @@ -1624,6 +1624,11 @@ messagesTextAddBtn.addEventListener("click", () => { background_colour: background_colour, }; messages.push(message); + + fetch("/sendMsgToJSON", { + method: "POST", + body: JSON.stringify(message), + }); }); function getMessageSettings(page) {