From 28c3efae232c9560fe8f34142acc972122e8741e Mon Sep 17 00:00:00 2001 From: Krille Date: Fri, 22 Dec 2023 19:41:18 +0100 Subject: [PATCH] chore: Follow up status feature --- lib/pages/chat_list/chat_list.dart | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/lib/pages/chat_list/chat_list.dart b/lib/pages/chat_list/chat_list.dart index 3c43dee0..2835f450 100644 --- a/lib/pages/chat_list/chat_list.dart +++ b/lib/pages/chat_list/chat_list.dart @@ -480,6 +480,8 @@ class ChatListController extends State } void setStatus() async { + final client = Matrix.of(context).client; + final currentPresence = await client.fetchCurrentPresence(client.userID!); final input = await showTextInputDialog( useRootNavigator: false, context: context, @@ -493,17 +495,19 @@ class ChatListController extends State maxLines: 6, minLines: 1, maxLength: 255, + initialText: currentPresence.statusMsg, ), ], ); if (input == null) return; + if (!mounted) return; await showFutureLoadingDialog( context: context, - future: () => Matrix.of(context).client.setPresence( - Matrix.of(context).client.userID!, - PresenceType.online, - statusMsg: input.single, - ), + future: () => client.setPresence( + client.userID!, + PresenceType.online, + statusMsg: input.single, + ), ); }