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