fix: no user feedback if client.getConfig() takes some time

When sending a file in an environment with bad internet
where Client.getConfig() takes some
seconds, the user does not get
any feedback at all.
This change now makes sure that
the user always sees the pending
event in the timeline before anything
else is done in the room.sendFileEvent method.
This commit is contained in:
Christian Kußowski 2025-06-01 18:01:21 +02:00
parent 8d8cbfb0b9
commit bac29d959d
No known key found for this signature in database
GPG Key ID: E067ECD60F1A0652
1 changed files with 1 additions and 1 deletions

View File

@ -771,6 +771,7 @@ class Room {
},
),
);
await _handleFakeSync(syncUpdate);
MatrixFile uploadFile = file; // ignore: omit_local_variable_types
// computing the thumbnail in case we can
@ -779,7 +780,6 @@ class Room {
syncUpdate.rooms!.join!.values.first.timeline!.events!.first
.unsigned![fileSendingStatusKey] =
FileSendingStatus.generatingThumbnail.name;
await _handleFakeSync(syncUpdate);
thumbnail ??= await file.generateThumbnail(
nativeImplementations: client.nativeImplementations,
customImageResizer: client.customImageResizer,