1
0
mirror of https://github.com/immich-app/immich.git synced 2024-12-25 10:43:13 +02:00

fix(mobile): recently add view show other user assets (#8184)

This commit is contained in:
Alex 2024-03-22 08:41:55 -05:00 committed by GitHub
parent d1e6843f3e
commit a56cf35d8c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,13 +1,18 @@
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:immich_mobile/shared/models/asset.dart';
import 'package:immich_mobile/shared/providers/db.provider.dart';
import 'package:immich_mobile/shared/providers/user.provider.dart';
import 'package:isar/isar.dart';
final recentlyAddedProvider = FutureProvider<List<Asset>>((ref) async {
final user = ref.read(currentUserProvider);
if (user == null) return [];
return ref
.watch(dbProvider)
.assets
.where()
.ownerIdEqualToAnyChecksum(user.isarId)
.sortByFileCreatedAtDesc()
.findAll();
});