From fa3a9f4f52bfb2e80958a13e6f77488ae588d001 Mon Sep 17 00:00:00 2001 From: ashilkn Date: Fri, 27 Sep 2024 17:27:15 +0530 Subject: [PATCH] [mob][photos] Stop passing sort order to DetailPage since DetailPage uses files in GalleryFilesState which updates when sort order changes in gallery --- mobile/lib/ui/viewer/file/detail_page.dart | 5 +---- .../lib/ui/viewer/gallery/component/gallery_file_widget.dart | 1 - 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/mobile/lib/ui/viewer/file/detail_page.dart b/mobile/lib/ui/viewer/file/detail_page.dart index 726b74d950..a4f9a26cc4 100644 --- a/mobile/lib/ui/viewer/file/detail_page.dart +++ b/mobile/lib/ui/viewer/file/detail_page.dart @@ -40,14 +40,12 @@ class DetailPageConfiguration { final int selectedIndex; final String tagPrefix; final DetailPageMode mode; - final bool sortOrderAsc; DetailPageConfiguration( this.files, this.selectedIndex, this.tagPrefix, { this.mode = DetailPageMode.full, - this.sortOrderAsc = false, }); DetailPageConfiguration copyWith({ @@ -55,13 +53,11 @@ class DetailPageConfiguration { GalleryLoader? asyncLoader, int? selectedIndex, String? tagPrefix, - bool? sortOrderAsc, }) { return DetailPageConfiguration( files ?? this.files, selectedIndex ?? this.selectedIndex, tagPrefix ?? this.tagPrefix, - sortOrderAsc: sortOrderAsc ?? this.sortOrderAsc, ); } } @@ -91,6 +87,7 @@ class _DetailPageState extends State { void initState() { super.initState(); _files = widget.config.files; + _selectedIndexNotifier.value = widget.config.selectedIndex; _pageController = PageController(initialPage: _selectedIndexNotifier.value); _guestViewEventSubscription = diff --git a/mobile/lib/ui/viewer/gallery/component/gallery_file_widget.dart b/mobile/lib/ui/viewer/gallery/component/gallery_file_widget.dart index 4558f2e9ed..1a5317c407 100644 --- a/mobile/lib/ui/viewer/gallery/component/gallery_file_widget.dart +++ b/mobile/lib/ui/viewer/gallery/component/gallery_file_widget.dart @@ -172,7 +172,6 @@ class GalleryFileWidget extends StatelessWidget { galleryFiles, galleryFiles.indexOf(file), tag, - sortOrderAsc: GalleryContextState.of(context)!.sortOrderAsc, ), ); routeToPage(context, page, forceCustomPageRoute: true);