mirror of
https://github.com/twonlyapp/twonly-app.git
synced 2026-01-15 12:48:41 +00:00
fix #175
This commit is contained in:
parent
a7298b74cf
commit
95ad761898
2 changed files with 8 additions and 2 deletions
|
|
@ -230,7 +230,7 @@ class ChatListEntry extends StatelessWidget {
|
|||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(builder: (context) {
|
||||
return MediaViewerView(contact);
|
||||
return MediaViewerView(contact, initialMessage: message);
|
||||
}),
|
||||
);
|
||||
} else if (message.downloadState == DownloadState.pending) {
|
||||
|
|
|
|||
|
|
@ -27,7 +27,9 @@ final _noScreenshot = NoScreenshot.instance;
|
|||
|
||||
class MediaViewerView extends StatefulWidget {
|
||||
final Contact contact;
|
||||
const MediaViewerView(this.contact, {super.key});
|
||||
const MediaViewerView(this.contact, {super.key, this.initialMessage});
|
||||
|
||||
final Message? initialMessage;
|
||||
|
||||
@override
|
||||
State<MediaViewerView> createState() => _MediaViewerViewState();
|
||||
|
|
@ -66,6 +68,10 @@ class _MediaViewerViewState extends State<MediaViewerView> {
|
|||
void initState() {
|
||||
super.initState();
|
||||
|
||||
if (widget.initialMessage != null) {
|
||||
allMediaFiles = [widget.initialMessage!];
|
||||
}
|
||||
|
||||
asyncLoadNextMedia(true);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue