Merge pull request #860 from pangeachat/not-actually-manual
allow sending if in manual igc mode
This commit is contained in:
commit
2127fbe265
2 changed files with 17 additions and 5 deletions
|
|
@ -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 (itEnabled && isRunningIT) return false;
|
||||
if (igc.igcTextData == null) return false;
|
||||
|
||||
// if they're in IT mode, don't let them send
|
||||
if (itEnabled && isRunningIT) 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…
Add table
Reference in a new issue