fix notification tap initial page view
Some checks failed
Flutter analyze & test / flutter_analyze_and_test (push) Has been cancelled

This commit is contained in:
otsmr 2026-04-12 02:22:30 +02:00
parent cfc6e945da
commit c42ff41eb8
2 changed files with 6 additions and 11 deletions

View file

@ -3,8 +3,9 @@
## 0.1.5 ## 0.1.5
- Fix: Reupload of media files was not working properly - Fix: Reupload of media files was not working properly
- Fix: Chats where ordered wrongly - Fix: Chats were sometimes ordered wrongly
- Fix: Typing indicator was not shown always - Fix: Typing indicator was not always shown
- Fix: Multiple smaller issues
## 0.1.4 ## 0.1.4

View file

@ -101,6 +101,7 @@ class HomeViewState extends State<HomeView> {
if (mounted) setState(() {}); if (mounted) setState(() {});
}; };
activePageIdx = widget.initialPage; activePageIdx = widget.initialPage;
globalUpdateOfHomeViewPageIndex = (index) { globalUpdateOfHomeViewPageIndex = (index) {
homeViewPageController.jumpToPage(index); homeViewPageController.jumpToPage(index);
setState(() { setState(() {
@ -111,9 +112,8 @@ class HomeViewState extends State<HomeView> {
if (response.payload != null && if (response.payload != null &&
response.payload!.startsWith(Routes.chats)) { response.payload!.startsWith(Routes.chats)) {
await routerProvider.push(response.payload!); await routerProvider.push(response.payload!);
} else {
globalUpdateOfHomeViewPageIndex(0);
} }
globalUpdateOfHomeViewPageIndex(0);
}); });
unawaited(_mainCameraController.selectCamera(0, true)); unawaited(_mainCameraController.selectCamera(0, true));
unawaited(initAsync()); unawaited(initAsync());
@ -153,20 +153,14 @@ class HomeViewState extends State<HomeView> {
if (widget.initialPage == 0 || if (widget.initialPage == 0 ||
(notificationAppLaunchDetails != null && (notificationAppLaunchDetails != null &&
notificationAppLaunchDetails.didNotificationLaunchApp)) { notificationAppLaunchDetails.didNotificationLaunchApp)) {
var pushed = false;
if (notificationAppLaunchDetails?.didNotificationLaunchApp ?? false) { if (notificationAppLaunchDetails?.didNotificationLaunchApp ?? false) {
final payload = final payload =
notificationAppLaunchDetails?.notificationResponse?.payload; notificationAppLaunchDetails?.notificationResponse?.payload;
if (payload != null && payload.startsWith(Routes.chats)) { if (payload != null && payload.startsWith(Routes.chats)) {
await routerProvider.push(payload); await routerProvider.push(payload);
pushed = true; globalUpdateOfHomeViewPageIndex(0);
} }
} }
if (!pushed) {
globalUpdateOfHomeViewPageIndex(0);
}
} }
final draftMedia = await twonlyDB.mediaFilesDao.getDraftMediaFile(); final draftMedia = await twonlyDB.mediaFilesDao.getDraftMediaFile();