don't run languageAssistance after dismissing IT
This commit is contained in:
parent
2c75090a06
commit
66e7eb79fa
4 changed files with 14 additions and 9 deletions
|
|
@ -89,7 +89,7 @@ class Choreographer {
|
|||
return;
|
||||
}
|
||||
|
||||
if (!igc.hasRelevantIGCTextData) {
|
||||
if (!igc.hasRelevantIGCTextData && !itController.dismissed) {
|
||||
getLanguageHelp().then((value) => _sendWithIGC(context));
|
||||
} else {
|
||||
_sendWithIGC(context);
|
||||
|
|
@ -206,7 +206,8 @@ class Choreographer {
|
|||
return;
|
||||
}
|
||||
|
||||
if (_textController.editType == EditType.igc) {
|
||||
if (_textController.editType == EditType.igc ||
|
||||
_textController.editType == EditType.itDismissed) {
|
||||
_lastChecked = _textController.text;
|
||||
_textController.editType = EditType.keyboard;
|
||||
return;
|
||||
|
|
@ -608,7 +609,9 @@ class Choreographer {
|
|||
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 (igc.igcTextData == null) {
|
||||
return itController.dismissed;
|
||||
}
|
||||
|
||||
// if they have relevant matches, don't let them send
|
||||
final hasITMatches =
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import 'dart:developer';
|
|||
import 'package:fluffychat/pangea/choreographer/controllers/error_service.dart';
|
||||
import 'package:fluffychat/pangea/constants/choreo_constants.dart';
|
||||
import 'package:fluffychat/pangea/enum/construct_use_type_enum.dart';
|
||||
import 'package:fluffychat/pangea/enum/edit_type.dart';
|
||||
import 'package:fluffychat/pangea/models/pangea_token_model.dart';
|
||||
import 'package:fluffychat/pangea/utils/error_handler.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
|
|
@ -25,6 +26,7 @@ class ITController {
|
|||
bool _willOpen = false;
|
||||
bool _isEditingSourceText = false;
|
||||
bool showChoiceFeedback = false;
|
||||
bool dismissed = false;
|
||||
|
||||
ITStartData? _itStartData;
|
||||
String? sourceText;
|
||||
|
|
@ -41,6 +43,7 @@ class ITController {
|
|||
_willOpen = false;
|
||||
showChoiceFeedback = false;
|
||||
_isEditingSourceText = false;
|
||||
dismissed = false;
|
||||
|
||||
_itStartData = null;
|
||||
sourceText = null;
|
||||
|
|
@ -70,9 +73,11 @@ class ITController {
|
|||
void closeIT() {
|
||||
// if the user hasn't gone through any IT steps, reset the text
|
||||
if (completedITSteps.isEmpty && sourceText != null) {
|
||||
choreographer.textController.editType = EditType.itDismissed;
|
||||
choreographer.textController.text = sourceText!;
|
||||
}
|
||||
clear();
|
||||
dismissed = true;
|
||||
}
|
||||
|
||||
/// if IGC isn't positive that text is full L1 then translate to L1
|
||||
|
|
@ -200,6 +205,7 @@ class ITController {
|
|||
|
||||
final ITResponseModel res =
|
||||
await _customInputTranslation(currentText + nextText);
|
||||
if (sourceText == null) return;
|
||||
|
||||
nextITStep = CurrentITStep(
|
||||
sourceText: sourceText!,
|
||||
|
|
|
|||
|
|
@ -56,12 +56,7 @@ class ChoreographerSendButtonState extends State<ChoreographerSendButton> {
|
|||
color: widget.controller.choreographer.assistanceState
|
||||
.stateColor(context),
|
||||
onPressed: () {
|
||||
widget.controller.choreographer.canSendMessage
|
||||
? widget.controller.choreographer.send(context)
|
||||
: !widget.controller.choreographer.isRunningIT
|
||||
? widget.controller.choreographer.igc
|
||||
.showFirstMatch(context)
|
||||
: null;
|
||||
widget.controller.choreographer.send(context);
|
||||
},
|
||||
tooltip: L10n.of(context)!.send,
|
||||
),
|
||||
|
|
|
|||
|
|
@ -5,4 +5,5 @@ enum EditType {
|
|||
alternativeTranslation,
|
||||
itGold,
|
||||
itStart,
|
||||
itDismissed,
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue