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) {
// #Pangea
if (choreographer.itController.isOpen) {
if (choreographer.itController.willOpen) {
return;
}
// Pangea#

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

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

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

Loading…
Cancel
Save