don't open media if context not mounted
This commit is contained in:
parent
44a1ec667e
commit
3e1552f246
2 changed files with 2 additions and 0 deletions
|
|
@ -28,6 +28,7 @@ class const AudioPlayer(
|
|||
final audio = await ref
|
||||
.read(ClientController.provider.notifier)
|
||||
.downloadMedia(.new(mxc: uri, encrypted: encrypted));
|
||||
if (!context.mounted) return;
|
||||
await player.open(Media(audio.path), play: false);
|
||||
if (context.mounted) loaded.value = true;
|
||||
});
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ class const VideoPlayer(
|
|||
final video = await ref
|
||||
.read(ClientController.provider.notifier)
|
||||
.downloadMedia(.new(mxc: uri, encrypted: encrypted));
|
||||
if (!context.mounted) return;
|
||||
await player.open(Media(video.path), play: false);
|
||||
if (context.mounted) loaded.value = true;
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue