chore: Display loading dialog when preparing voice message

Signed-off-by: Christian Kußowski <c.kussowski@famedly.com>
pull/1850/head
Christian Kußowski 6 months ago
parent 6c332c1d83
commit dc26309489
No known key found for this signature in database
GPG Key ID: E067ECD60F1A0652

@ -626,10 +626,19 @@ class ChatController extends State<ChatPageWithRoom>
);
if (result == null) return;
final audioFile = XFile(result.path);
final bytesResult = await showFutureLoadingDialog(
context: context,
future: audioFile.readAsBytes,
);
final bytes = bytesResult.result;
if (bytes == null) return;
final file = MatrixAudioFile(
bytes: await audioFile.readAsBytes(),
bytes: bytes,
name: result.fileName ?? audioFile.path,
);
await room.sendFileEvent(
file,
inReplyTo: replyEvent,

Loading…
Cancel
Save