fix(mobile): jump to previous asset when last asset is deleted (#25563)

* fix(mobile): fix wrong index, update pageController

* fix(mobile): refactor code

---------

Co-authored-by: Peter Ombodi <peter.ombodi@gmail.com>
Co-authored-by: shenlong <139912620+shenlong-tanwen@users.noreply.github.com>
This commit is contained in:
Peter Ombodi 2026-02-05 20:19:40 +02:00 committed by GitHub
parent 7211d80e5f
commit b0e1a425b3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -469,6 +469,11 @@ class _AssetViewerState extends ConsumerState<AssetViewer> {
}
}
if (index >= totalAssets) {
index = totalAssets - 1;
pageController.jumpToPage(index);
}
if (assetReloadRequested) {
assetReloadRequested = false;
_onAssetReloadEvent(index);