allow sending if in manual igc mode

pull/1476/head
William Jordan-Cooley 1 year ago
parent d3d7acda63
commit a3c5ab15d8

@ -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;
}
}

@ -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:

Loading…
Cancel
Save