mirror of
https://github.com/krille-chan/fluffychat
synced 2024-09-17 08:15:09 +00:00
Merge pull request #739 from krille-chan/krille/send-on-enter-fix
fix: Cannot change send on enter on desktop
This commit is contained in:
commit
a14f920a2b
4 changed files with 6 additions and 6 deletions
|
@ -47,7 +47,7 @@ abstract class AppConfig {
|
|||
static bool separateChatTypes = false;
|
||||
static bool autoplayImages = true;
|
||||
static bool sendTypingNotifications = true;
|
||||
static bool sendOnEnter = false;
|
||||
static bool? sendOnEnter;
|
||||
static bool experimentalVoip = false;
|
||||
static const bool hideTypingUsernames = false;
|
||||
static const bool hideAllStateEvents = false;
|
||||
|
|
|
@ -251,7 +251,9 @@ class ChatInputRow extends StatelessWidget {
|
|||
autofocus: !PlatformInfos.isMobile,
|
||||
keyboardType: TextInputType.multiline,
|
||||
textInputAction:
|
||||
AppConfig.sendOnEnter ? TextInputAction.send : null,
|
||||
AppConfig.sendOnEnter ?? !PlatformInfos.isMobile
|
||||
? TextInputAction.send
|
||||
: null,
|
||||
onSubmitted: controller.onInputBarSubmitted,
|
||||
onSubmitImage: controller.sendImageFromClipBoard,
|
||||
focusNode: controller.inputFocus,
|
||||
|
|
|
@ -394,9 +394,7 @@ class InputBar extends StatelessWidget {
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final useShortCuts = (PlatformInfos.isWeb ||
|
||||
PlatformInfos.isDesktop ||
|
||||
AppConfig.sendOnEnter);
|
||||
final useShortCuts = (AppConfig.sendOnEnter ?? !PlatformInfos.isMobile);
|
||||
return Shortcuts(
|
||||
shortcuts: !useShortCuts
|
||||
? {}
|
||||
|
|
|
@ -74,7 +74,7 @@ class SettingsChatView extends StatelessWidget {
|
|||
title: L10n.of(context)!.sendOnEnter,
|
||||
onChanged: (b) => AppConfig.sendOnEnter = b,
|
||||
storeKey: SettingKeys.sendOnEnter,
|
||||
defaultValue: AppConfig.sendOnEnter,
|
||||
defaultValue: AppConfig.sendOnEnter ?? !PlatformInfos.isMobile,
|
||||
),
|
||||
SettingsSwitchListTile.adaptive(
|
||||
title: L10n.of(context)!.experimentalVideoCalls,
|
||||
|
|
Loading…
Reference in a new issue