fix: Notifications on web not working when avatar could not be pre downloaded
This commit is contained in:
parent
1ae60dd2b9
commit
422e94ab45
1 changed files with 12 additions and 8 deletions
|
|
@ -53,14 +53,18 @@ 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:
|
||||||
await client.downloadMxcCached(
|
try {
|
||||||
avatarUrl,
|
await client.downloadMxcCached(
|
||||||
width: size,
|
avatarUrl,
|
||||||
height: size,
|
width: size,
|
||||||
thumbnailMethod: thumbnailMethod,
|
height: size,
|
||||||
isThumbnail: true,
|
thumbnailMethod: thumbnailMethod,
|
||||||
rounded: true,
|
isThumbnail: 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(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue