move canSend function from igcController to choreographer

This commit is contained in:
ggurdin 2024-10-25 09:51:39 -04:00
parent f4c0637f83
commit 01f07c5584
No known key found for this signature in database
GPG key ID: A01CB41737CBB478

View file

@ -192,18 +192,4 @@ class IgcController {
// Not sure why this is here
// MatrixState.pAnyState.closeOverlay();
}
bool get canSendMessage {
if (choreographer.isFetching) return false;
if (igcTextData == null ||
choreographer.errorService.isError ||
igcTextData!.matches.isEmpty) {
return true;
}
return !((choreographer.itEnabled &&
igcTextData!.matches.any((match) => match.isITStart)) ||
(choreographer.igcEnabled &&
igcTextData!.matches.any((match) => !match.isITStart)));
}
}