Skip to content

Commit

Permalink
Merge pull request #50 from dougollerenshaw/disable_submit_button
Browse files Browse the repository at this point in the history
Fixed bug to disable submit button
  • Loading branch information
dougollerenshaw authored Oct 10, 2024
2 parents 537c3ea + 4139ccd commit b8e8317
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 b8e8317

Please sign in to comment.