fix: Notifications on web not working when avatar could not be pre downloaded

This commit is contained in:
Christian Kußowski 2025-10-28 07:25:55 +01:00
commit 422e94ab45
No known key found for this signature in database
GPG key ID: E067ECD60F1A0652

View file

@ -53,6 +53,7 @@ extension LocalNotificationsExtension on MatrixState {
const size = 128; const size = 128;
const thumbnailMethod = ThumbnailMethod.crop; const thumbnailMethod = ThumbnailMethod.crop;
// Pre-cache so that we can later just set the thumbnail uri as icon: // Pre-cache so that we can later just set the thumbnail uri as icon:
try {
await client.downloadMxcCached( await client.downloadMxcCached(
avatarUrl, avatarUrl,
width: size, width: size,
@ -61,6 +62,9 @@ extension LocalNotificationsExtension on MatrixState {
isThumbnail: true, isThumbnail: true,
rounded: true, rounded: true,
); );
} catch (e, s) {
Logs().d('Unable to pre-download avatar for web notification', e, s);
}
thumbnailUri = thumbnailUri =
await event.senderFromMemoryOrFallback.avatarUrl?.getThumbnailUri( await event.senderFromMemoryOrFallback.avatarUrl?.getThumbnailUri(