mirror of
https://github.com/immich-app/immich.git
synced 2025-05-31 20:25:32 -04:00
fix(mobile): full refresh doesn't get albums (#15560)
This commit is contained in:
parent
aaea5cf1ad
commit
6c95eb22b7
@ -83,11 +83,18 @@ class PhotosPage extends HookConsumerWidget {
|
|||||||
|
|
||||||
Future<void> refreshAssets() async {
|
Future<void> refreshAssets() async {
|
||||||
final fullRefresh = refreshCount.value > 0;
|
final fullRefresh = refreshCount.value > 0;
|
||||||
await ref.read(assetProvider.notifier).getAllAsset(clear: fullRefresh);
|
|
||||||
if (fullRefresh) {
|
if (fullRefresh) {
|
||||||
|
Future.wait([
|
||||||
|
ref.read(assetProvider.notifier).getAllAsset(clear: true),
|
||||||
|
ref.read(albumProvider.notifier).refreshRemoteAlbums(),
|
||||||
|
]);
|
||||||
|
|
||||||
// refresh was forced: user requested another refresh within 2 seconds
|
// refresh was forced: user requested another refresh within 2 seconds
|
||||||
refreshCount.value = 0;
|
refreshCount.value = 0;
|
||||||
} else {
|
} else {
|
||||||
|
await ref.read(assetProvider.notifier).getAllAsset(clear: false);
|
||||||
|
|
||||||
refreshCount.value++;
|
refreshCount.value++;
|
||||||
// set counter back to 0 if user does not request refresh again
|
// set counter back to 0 if user does not request refresh again
|
||||||
Timer(const Duration(seconds: 4), () => refreshCount.value = 0);
|
Timer(const Duration(seconds: 4), () => refreshCount.value = 0);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user