From 66a64f924b26d7351ce7cb8ffa3007fe9717dc43 Mon Sep 17 00:00:00 2001 From: Mic Date: Fri, 20 Jun 2025 22:17:41 +0200 Subject: [PATCH] fix: reply type button enable/disable only when present --- js/mzta-chatgpt.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/js/mzta-chatgpt.js b/js/mzta-chatgpt.js index 296644d0..be644d9c 100644 --- a/js/mzta-chatgpt.js +++ b/js/mzta-chatgpt.js @@ -650,16 +650,21 @@ document.addEventListener("selectionchange", function() { selectionChangeTimeout = setTimeout(function() { let btn_ok = document.getElementById('mzta-btn_ok'); let btn_diff = document.getElementById('mzta-btn_diff'); - let btn_reply_type = document.getElementById('mzta-btn_change_reply_type'); if (isSomethingSelected()) { enableButton(btn_ok); - enableButton(btn_reply_type); + if(current_action == '1'){ + let btn_reply_type = document.getElementById('mzta-btn_change_reply_type'); + enableButton(btn_reply_type); + } if(mztaUseDiffViewer == '1'){ enableButton(btn_diff); } } else { disableButton(btn_ok); - disableButton(btn_reply_type); + if(current_action == '1'){ + let btn_reply_type = document.getElementById('mzta-btn_change_reply_type'); + disableButton(btn_reply_type); + } if(mztaUseDiffViewer == '1'){ disableButton(btn_diff); }