don't allow users to edit the input bar during IT

pull/1476/head
ggurdin 1 year ago
parent b6a63d3701
commit cf1f79147a
No known key found for this signature in database
GPG Key ID: A01CB41737CBB478

@ -1419,7 +1419,7 @@ class ChatController extends State<ChatPageWithRoom>
void onSelectMessage(Event event) { void onSelectMessage(Event event) {
// #Pangea // #Pangea
if (choreographer.itController.isOpen) { if (choreographer.itController.willOpen) {
return; return;
} }
// Pangea# // Pangea#

@ -321,6 +321,7 @@ class ChatInputRow extends StatelessWidget {
// #Pangea // #Pangea
// hintText: L10n.of(context)!.writeAMessage, // hintText: L10n.of(context)!.writeAMessage,
hintText: hintText(), hintText: hintText(),
disabledBorder: InputBorder.none,
// Pangea# // Pangea#
hintMaxLines: 1, hintMaxLines: 1,
border: InputBorder.none, border: InputBorder.none,

@ -478,6 +478,8 @@ class InputBar extends StatelessWidget {
// builder: (context, controller, focusNode) => TextField( // builder: (context, controller, focusNode) => TextField(
builder: (context, _, focusNode) => TextField( builder: (context, _, focusNode) => TextField(
enableSuggestions: false, enableSuggestions: false,
readOnly:
controller != null && controller!.choreographer.isRunningIT,
// Pangea# // Pangea#
controller: controller, controller: controller,
focusNode: focusNode, focusNode: focusNode,

@ -261,7 +261,7 @@ class Choreographer {
// debugger(when: kDebugMode); // debugger(when: kDebugMode);
} }
await (choreoMode == ChoreoMode.it && !itController.isTranslationDone await (isRunningIT
? itController.getTranslationData(_useCustomInput) ? itController.getTranslationData(_useCustomInput)
: igc.getIGCTextData( : igc.getIGCTextData(
onlyTokensAndLanguageDetection: onlyTokensAndLanguageDetection, onlyTokensAndLanguageDetection: onlyTokensAndLanguageDetection,
@ -418,7 +418,7 @@ class Choreographer {
setState(); setState();
} }
giveInputFocus() { void giveInputFocus() {
Future.delayed(Duration.zero, () { Future.delayed(Duration.zero, () {
chatController.inputFocus.requestFocus(); chatController.inputFocus.requestFocus();
}); });
@ -478,6 +478,9 @@ class Choreographer {
bool get _noChange => bool get _noChange =>
_lastChecked != null && _lastChecked == _textController.text; _lastChecked != null && _lastChecked == _textController.text;
bool get isRunningIT =>
choreoMode == ChoreoMode.it && !itController.isTranslationDone;
void startLoading() { void startLoading() {
_lastChecked = _textController.text; _lastChecked = _textController.text;
isFetching = true; isFetching = true;
@ -505,8 +508,6 @@ class Choreographer {
} }
} }
bool get showIsError => !itController.isOpen && errorService.isError;
LayerLinkAndKey get itBarLinkAndKey => LayerLinkAndKey get itBarLinkAndKey =>
MatrixState.pAnyState.layerLinkAndKey(itBarTransformTargetKey); MatrixState.pAnyState.layerLinkAndKey(itBarTransformTargetKey);

Loading…
Cancel
Save