mirror of
https://github.com/immich-app/immich.git
synced 2025-01-12 15:32:36 +02:00
fix(mobile): recently add view show other user assets (#8184)
This commit is contained in:
parent
d1e6843f3e
commit
a56cf35d8c
@ -1,13 +1,18 @@
|
|||||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||||
import 'package:immich_mobile/shared/models/asset.dart';
|
import 'package:immich_mobile/shared/models/asset.dart';
|
||||||
import 'package:immich_mobile/shared/providers/db.provider.dart';
|
import 'package:immich_mobile/shared/providers/db.provider.dart';
|
||||||
|
import 'package:immich_mobile/shared/providers/user.provider.dart';
|
||||||
import 'package:isar/isar.dart';
|
import 'package:isar/isar.dart';
|
||||||
|
|
||||||
final recentlyAddedProvider = FutureProvider<List<Asset>>((ref) async {
|
final recentlyAddedProvider = FutureProvider<List<Asset>>((ref) async {
|
||||||
|
final user = ref.read(currentUserProvider);
|
||||||
|
if (user == null) return [];
|
||||||
|
|
||||||
return ref
|
return ref
|
||||||
.watch(dbProvider)
|
.watch(dbProvider)
|
||||||
.assets
|
.assets
|
||||||
.where()
|
.where()
|
||||||
|
.ownerIdEqualToAnyChecksum(user.isarId)
|
||||||
.sortByFileCreatedAtDesc()
|
.sortByFileCreatedAtDesc()
|
||||||
.findAll();
|
.findAll();
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user