Skip to content

Commit

Permalink
Fixed bug to disable submit button
Browse files Browse the repository at this point in the history
  • Loading branch information
dougollerenshaw committed Oct 10, 2024
1 parent 537c3ea commit 4139ccd
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions codeaide/ui/chat_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def __init__(self, chat_handler):
self.code_popup = None
self.waiting_for_api_key = False
self.chat_contents = []
self.original_text = "" # Add this line to store the original text
self.is_recording = False

# Load microphone icons
self.green_mic_icon = QIcon(
Expand Down Expand Up @@ -586,7 +586,10 @@ def show_traceback_dialog(self, traceback_text):
self.logger.info("ChatWindow: User chose to ignore the traceback")

def update_submit_button_state(self):
self.submit_button.setEnabled(bool(self.input_text.toPlainText().strip()))
if not self.is_recording:
self.submit_button.setEnabled(bool(self.input_text.toPlainText().strip()))
else:
self.submit_button.setEnabled(False)

def toggle_recording(self):
if not hasattr(self, "is_recording"):
Expand Down

0 comments on commit 4139ccd

Please sign in to comment.