Merge pull request #739 from krille-chan/krille/send-on-enter-fix

fix: Cannot change send on enter on desktop
pull/741/head
Krille-chan 2 years ago committed by GitHub
commit a14f920a2b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -47,7 +47,7 @@ abstract class AppConfig {
static bool separateChatTypes = false; static bool separateChatTypes = false;
static bool autoplayImages = true; static bool autoplayImages = true;
static bool sendTypingNotifications = true; static bool sendTypingNotifications = true;
static bool sendOnEnter = false; static bool? sendOnEnter;
static bool experimentalVoip = false; static bool experimentalVoip = false;
static const bool hideTypingUsernames = false; static const bool hideTypingUsernames = false;
static const bool hideAllStateEvents = false; static const bool hideAllStateEvents = false;

@ -251,7 +251,9 @@ class ChatInputRow extends StatelessWidget {
autofocus: !PlatformInfos.isMobile, autofocus: !PlatformInfos.isMobile,
keyboardType: TextInputType.multiline, keyboardType: TextInputType.multiline,
textInputAction: textInputAction:
AppConfig.sendOnEnter ? TextInputAction.send : null, AppConfig.sendOnEnter ?? !PlatformInfos.isMobile
? TextInputAction.send
: null,
onSubmitted: controller.onInputBarSubmitted, onSubmitted: controller.onInputBarSubmitted,
onSubmitImage: controller.sendImageFromClipBoard, onSubmitImage: controller.sendImageFromClipBoard,
focusNode: controller.inputFocus, focusNode: controller.inputFocus,

@ -394,9 +394,7 @@ class InputBar extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final useShortCuts = (PlatformInfos.isWeb || final useShortCuts = (AppConfig.sendOnEnter ?? !PlatformInfos.isMobile);
PlatformInfos.isDesktop ||
AppConfig.sendOnEnter);
return Shortcuts( return Shortcuts(
shortcuts: !useShortCuts shortcuts: !useShortCuts
? {} ? {}

@ -74,7 +74,7 @@ class SettingsChatView extends StatelessWidget {
title: L10n.of(context)!.sendOnEnter, title: L10n.of(context)!.sendOnEnter,
onChanged: (b) => AppConfig.sendOnEnter = b, onChanged: (b) => AppConfig.sendOnEnter = b,
storeKey: SettingKeys.sendOnEnter, storeKey: SettingKeys.sendOnEnter,
defaultValue: AppConfig.sendOnEnter, defaultValue: AppConfig.sendOnEnter ?? !PlatformInfos.isMobile,
), ),
SettingsSwitchListTile.adaptive( SettingsSwitchListTile.adaptive(
title: L10n.of(context)!.experimentalVideoCalls, title: L10n.of(context)!.experimentalVideoCalls,

Loading…
Cancel
Save