From df8bef04513474ca8e6105b92d1701de49ee0997 Mon Sep 17 00:00:00 2001 From: Christian Pauly Date: Sun, 29 May 2022 11:34:21 +0200 Subject: [PATCH] refactor: Sharing intent --- lib/pages/chat_list/chat_list.dart | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/pages/chat_list/chat_list.dart b/lib/pages/chat_list/chat_list.dart index fcdf0182..47096ce3 100644 --- a/lib/pages/chat_list/chat_list.dart +++ b/lib/pages/chat_list/chat_list.dart @@ -142,8 +142,7 @@ class ChatListController extends State with TickerProviderStateMixin { void _processIncomingSharedFiles(List files) { if (files.isEmpty) return; - VRouter.of(context).to('/rooms'); - final file = File(files.first.path); + final file = File(files.first.path.replaceFirst('file://', '')); Matrix.of(context).shareContent = { 'msgtype': 'chat.fluffy.shared_file', @@ -152,11 +151,11 @@ class ChatListController extends State with TickerProviderStateMixin { name: file.path, ).detectFileType, }; + VRouter.of(context).to('/rooms'); } void _processIncomingSharedText(String? text) { if (text == null) return; - VRouter.of(context).to('/rooms'); if (text.toLowerCase().startsWith(AppConfig.deepLinkPrefix) || text.toLowerCase().startsWith(AppConfig.inviteLinkPrefix) || (text.toLowerCase().startsWith(AppConfig.schemePrefix) && @@ -167,6 +166,7 @@ class ChatListController extends State with TickerProviderStateMixin { 'msgtype': 'm.text', 'body': text, }; + VRouter.of(context).to('/rooms'); } void _processIncomingUris(String? text) async {