Merge pull request #4937 from pangeachat/4923-treat-whitespace-only-message-like-empty-message

chore: prevent running IGC on empty message
This commit is contained in:
ggurdin 2025-12-22 14:25:36 -05:00 committed by GitHub
commit 6795bc698b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View file

@ -183,8 +183,8 @@ class Choreographer extends ChangeNotifier {
}
// update assistance state from no message => not fetched and vice versa
if (_lastChecked == null ||
_lastChecked!.isEmpty ||
textController.text.isEmpty) {
_lastChecked!.trim().isEmpty ||
textController.text.trim().isEmpty) {
notifyListeners();
}

View file

@ -8,7 +8,7 @@ extension ChoregrapherStateExtension on Choreographer {
final isSubscribed =
MatrixState.pangeaController.subscriptionController.isSubscribed;
if (isSubscribed == false) return AssistanceStateEnum.noSub;
if (currentText.isEmpty && itController.sourceText.value == null) {
if (currentText.trim().isEmpty && itController.sourceText.value == null) {
return AssistanceStateEnum.noMessage;
}