Fix: open chat after the image expires in case a draft message exists

This commit is contained in:
otsmr 2026-02-21 01:25:42 +01:00
parent 15096056c0
commit 3bb2620369
2 changed files with 13 additions and 1 deletions

View file

@ -5,6 +5,7 @@
- Feature: Verification checkmark for friends
- Fix: Added contacts in contact sharing where not click able
- Fix: Open chat after the image expires in case a draft message exists
- Fix: Restore flames as a plus user
- Fix: Route not found when sharing image
- Fix: Increase recent limit in emoji keyboard

View file

@ -4,10 +4,12 @@ import 'package:clock/clock.dart';
import 'package:drift/drift.dart' show Value;
import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:go_router/go_router.dart';
import 'package:lottie/lottie.dart';
import 'package:no_screenshot/no_screenshot.dart';
import 'package:photo_view/photo_view.dart';
import 'package:twonly/globals.dart';
import 'package:twonly/src/constants/routes.keys.dart';
import 'package:twonly/src/database/daos/contacts.dao.dart';
import 'package:twonly/src/database/tables/mediafiles.table.dart'
show DownloadState, MediaType;
@ -153,7 +155,16 @@ class _MediaViewerViewState extends State<MediaViewerView> {
progressTimer?.cancel();
if (allMediaFiles.isEmpty) {
final group = await twonlyDB.groupsDao.getGroup(widget.group.groupId);
if (mounted) {
if (group != null &&
group.draftMessage != null &&
group.draftMessage != '') {
context.replace(Routes.chatsMessages, extra: group);
} else {
Navigator.pop(context);
}
}
} else {
await loadCurrentMediaFile();
}