From 186818cf5f2f3130b5b6d64606af462024826f16 Mon Sep 17 00:00:00 2001 From: Akshay Mayekar Date: Tue, 16 Apr 2024 17:48:16 +0530 Subject: [PATCH 1/2] Added new changes --- dev/init.js | 2 +- src/layout.html | 5 +++-- src/main.js | 9 ++++++++- src/style.scss | 4 ++++ 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/dev/init.js b/dev/init.js index 5567427..c0488a7 100644 --- a/dev/init.js +++ b/dev/init.js @@ -109,7 +109,7 @@ async function sendMessage(message, optionalFiles) { async function reportMessage(messageId, payload, message) { console.log("messageId " + messageId); console.log("message " + message); - console.log("payload :>> ", JSON.parse(payload)); + console.log("payload :>> ", payload); } const chat = TarkaChat.init({ diff --git a/src/layout.html b/src/layout.html index 9bf11e2..faa6577 100644 --- a/src/layout.html +++ b/src/layout.html @@ -10,13 +10,14 @@
- +
diff --git a/src/main.js b/src/main.js index 9c50ceb..1d99a6e 100644 --- a/src/main.js +++ b/src/main.js @@ -194,6 +194,11 @@ export default { const msgInput = document.querySelector("#tarka-chat .chat-input"); const cancelButton = document.querySelector(".cancel-btn"); const reportButton = document.querySelector(".report-btn"); + const reportText = document.querySelector(".report-dialog .report-text"); + + reportText.addEventListener("input", (e) => { + reportButton.disabled = reportText.value === ""; + }); cancelButton.addEventListener("click", () => { const messageContainer = document.querySelector( @@ -201,8 +206,8 @@ export default { ); const footer = document.querySelector(".footer"); const reportDialog = document.querySelector(".report-dialog"); - const reportText = document.querySelector(".report-dialog .report-text"); reportText.value = ""; + reportButton.disabled = true; reportDialog.style.display = "none"; messageContainer.classList.remove("blur-background"); footer.classList.remove("blur-background"); @@ -226,6 +231,8 @@ export default { JSON.parse(wrapper.getAttribute("data-payload")), reportMessageInput.value, ); + reportText.value = ""; + reportButton.disabled = true; reportDialog.style.display = "none"; messageContainer.classList.remove("blur-background"); footer.classList.remove("blur-background"); diff --git a/src/style.scss b/src/style.scss index f110217..6461b16 100644 --- a/src/style.scss +++ b/src/style.scss @@ -294,6 +294,10 @@ margin-left: 10px; border: 1px solid var(--primary-primary, #9500b3); border-radius: 5px; + + &:disabled { + background-color: grey; + } } } } From 70c1d49ea6b53317c601867e4d2f996e5d6f8028 Mon Sep 17 00:00:00 2001 From: Akshay Mayekar Date: Tue, 16 Apr 2024 17:48:45 +0530 Subject: [PATCH 2/2] Bumped up patch version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 511c25a..f698fc8 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "tarka-chat", "private": true, - "version": "2.4.2", + "version": "2.4.3", "type": "module", "repository": { "type": "git",