diff --git a/lib/pangea/choreographer/controllers/choreographer.dart b/lib/pangea/choreographer/controllers/choreographer.dart index 63895d550..6f65ea836 100644 --- a/lib/pangea/choreographer/controllers/choreographer.dart +++ b/lib/pangea/choreographer/controllers/choreographer.dart @@ -590,19 +590,31 @@ class Choreographer { } bool get canSendMessage { - if (isFetching) return false; + // if there's an error, let them send. we don't want to block them from sending in this case if (errorService.isError) return true; + + // if they're in IT mode, don't let them send if (itEnabled && isRunningIT) return false; - if (igc.igcTextData == null) return false; + // if they've turned off IGC then let them send the message when they want + if (!isAutoIGCEnabled) return true; + + // if we're in the middle of fetching results, don't let them send + if (isFetching) return false; + + // they're supposed to run IGC but haven't yet, don't let them send + if (isAutoIGCEnabled && igc.igcTextData == null) return false; + + // if they have relevant matches, don't let them send final hasITMatches = igc.igcTextData!.matches.any((match) => match.isITStart); final hasIGCMatches = igc.igcTextData!.matches.any((match) => !match.isITStart); - if ((itEnabled && hasITMatches) || (igcEnabled && hasIGCMatches)) { return false; } + + // otherwise, let them send return true; } } diff --git a/lib/pangea/widgets/chat/message_toolbar.dart b/lib/pangea/widgets/chat/message_toolbar.dart index 36b3cc45c..bc6ed54bc 100644 --- a/lib/pangea/widgets/chat/message_toolbar.dart +++ b/lib/pangea/widgets/chat/message_toolbar.dart @@ -47,7 +47,7 @@ class MessageToolbar extends StatelessWidget { final bool messageInUserL2 = pangeaMessageEvent.messageDisplayLangCode == MatrixState.pangeaController.languageController.userL2?.langCode; - // If not in the target language, set to nullMode + // If not in the target language show specific messsage if (!messageInUserL2) { return MessageDisplayCard( displayText: