From 4edfa7fd50b1e9f2ac9395066fe66bafd89d330b Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Wed, 8 Jan 2025 17:37:16 +0800 Subject: [PATCH] :bug: Optimizing styling of chat --- lib/screens/chat.dart | 2 +- lib/widgets/chat/chat_message.dart | 3 +++ lib/widgets/chat/chat_message_input.dart | 4 +++- lib/widgets/navigation/app_drawer_navigation.dart | 2 +- 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/screens/chat.dart b/lib/screens/chat.dart index 99fc8b3..79812be 100644 --- a/lib/screens/chat.dart +++ b/lib/screens/chat.dart @@ -236,7 +236,7 @@ class _ChatScreenState extends State { 'alias': channel.alias, }, ).then((value) { - if (value == true) _refreshChannels(); + if (mounted) _refreshChannels(); }); }, ); diff --git a/lib/widgets/chat/chat_message.dart b/lib/widgets/chat/chat_message.dart index 5939bf4..74e5517 100644 --- a/lib/widgets/chat/chat_message.dart +++ b/lib/widgets/chat/chat_message.dart @@ -128,6 +128,9 @@ class ChatMessage extends StatelessWidget { if (isCompact) const Gap(8), if (data.preload?.quoteEvent != null) StyledWidget(Container( + constraints: BoxConstraints( + maxWidth: 480, + ), decoration: BoxDecoration( borderRadius: const BorderRadius.all(Radius.circular(8)), border: Border.all( diff --git a/lib/widgets/chat/chat_message_input.dart b/lib/widgets/chat/chat_message_input.dart index 56211fe..b8c443b 100644 --- a/lib/widgets/chat/chat_message_input.dart +++ b/lib/widgets/chat/chat_message_input.dart @@ -101,7 +101,9 @@ class ChatMessageInputState extends State { }, ); - _attachments[i] = PostWriteMedia(item); + setState(() { + _attachments[i] = PostWriteMedia(item); + }); } } catch (err) { if (!mounted) return; diff --git a/lib/widgets/navigation/app_drawer_navigation.dart b/lib/widgets/navigation/app_drawer_navigation.dart index a71b935..58eec5d 100644 --- a/lib/widgets/navigation/app_drawer_navigation.dart +++ b/lib/widgets/navigation/app_drawer_navigation.dart @@ -49,7 +49,7 @@ class _AppNavigationDrawerState extends State { backgroundColor: backgroundColor, selectedIndex: nav.currentIndex, children: [ - if (!kIsWeb && (Platform.isWindows || Platform.isLinux || Platform.isMacOS)) + if (!kIsWeb && (Platform.isWindows || Platform.isLinux || Platform.isMacOS) && !cfg.drawerIsExpanded) Container( decoration: BoxDecoration( border: Border(