mirror of
https://github.com/twonlyapp/twonly-app.git
synced 2026-01-15 20:38:40 +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(
|
Navigator.push(
|
||||||
context,
|
context,
|
||||||
MaterialPageRoute(builder: (context) {
|
MaterialPageRoute(builder: (context) {
|
||||||
return MediaViewerView(contact);
|
return MediaViewerView(contact, initialMessage: message);
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
} else if (message.downloadState == DownloadState.pending) {
|
} else if (message.downloadState == DownloadState.pending) {
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,9 @@ final _noScreenshot = NoScreenshot.instance;
|
||||||
|
|
||||||
class MediaViewerView extends StatefulWidget {
|
class MediaViewerView extends StatefulWidget {
|
||||||
final Contact contact;
|
final Contact contact;
|
||||||
const MediaViewerView(this.contact, {super.key});
|
const MediaViewerView(this.contact, {super.key, this.initialMessage});
|
||||||
|
|
||||||
|
final Message? initialMessage;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<MediaViewerView> createState() => _MediaViewerViewState();
|
State<MediaViewerView> createState() => _MediaViewerViewState();
|
||||||
|
|
@ -66,6 +68,10 @@ class _MediaViewerViewState extends State<MediaViewerView> {
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
|
|
||||||
|
if (widget.initialMessage != null) {
|
||||||
|
allMediaFiles = [widget.initialMessage!];
|
||||||
|
}
|
||||||
|
|
||||||
asyncLoadNextMedia(true);
|
asyncLoadNextMedia(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue