From 168b8b076fd23686486e670703e7899d11f93472 Mon Sep 17 00:00:00 2001 From: Sorunome Date: Sun, 20 Sep 2020 10:35:19 +0200 Subject: [PATCH] fix: Don't double-confirm sending audio messages --- lib/views/chat.dart | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/lib/views/chat.dart b/lib/views/chat.dart index c471336..f4e6c9b 100644 --- a/lib/views/chat.dart +++ b/lib/views/chat.dart @@ -253,13 +253,14 @@ class _ChatState extends State<_Chat> { )); if (result == null) return; final audioFile = File(result); - await showDialog( - context: context, - builder: (context) => SendFileDialog( - file: MatrixAudioFile( - bytes: audioFile.readAsBytesSync(), name: audioFile.path), - room: room, - )); + // as we already explicitly say send in the recording dialog, + // we do not need the send file dialog anymore. We can just send this straight away. + await SimpleDialogs(context).tryRequestWithLoadingDialog( + room.sendFileEvent( + MatrixAudioFile( + bytes: audioFile.readAsBytesSync(), name: audioFile.path), + ), + ); } String _getSelectedEventString(BuildContext context) {