mirror of
https://github.com/immich-app/immich
synced 2025-10-17 18:19:27 +00:00
fix(mobile): memory lane rebuild (#21350)
* avoid unnecessary timeline rebuild * add key * handle disabled memories * avoid rebuild if no memories
This commit is contained in:
parent
dc6ac3aaec
commit
a5841a8bf4
4 changed files with 24 additions and 28 deletions
|
|
@ -14,13 +14,12 @@ final driftMemoryServiceProvider = Provider<DriftMemoryService>(
|
|||
(ref) => DriftMemoryService(ref.watch(driftMemoryRepositoryProvider)),
|
||||
);
|
||||
|
||||
final driftMemoryFutureProvider = FutureProvider.autoDispose<List<DriftMemory>>((ref) async {
|
||||
final user = ref.watch(currentUserProvider);
|
||||
if (user == null) {
|
||||
return [];
|
||||
final driftMemoryFutureProvider = FutureProvider.autoDispose<List<DriftMemory>>((ref) {
|
||||
final (userId, enabled) = ref.watch(currentUserProvider.select((user) => (user?.id, user?.memoryEnabled ?? true)));
|
||||
if (userId == null || !enabled) {
|
||||
return const [];
|
||||
}
|
||||
|
||||
final service = ref.watch(driftMemoryServiceProvider);
|
||||
|
||||
return service.getMemoryLane(user.id);
|
||||
return service.getMemoryLane(userId);
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue