mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
fix: show only owned assets in places and map (#22585)
Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
This commit is contained in:
parent
950f268cb0
commit
a2b25b7a74
6 changed files with 44 additions and 19 deletions
|
|
@ -3,6 +3,7 @@ import 'package:immich_mobile/domain/services/asset.service.dart';
|
|||
import 'package:immich_mobile/infrastructure/repositories/local_asset.repository.dart';
|
||||
import 'package:immich_mobile/infrastructure/repositories/remote_asset.repository.dart';
|
||||
import 'package:immich_mobile/providers/infrastructure/db.provider.dart';
|
||||
import 'package:immich_mobile/providers/user.provider.dart';
|
||||
|
||||
final localAssetRepository = Provider<DriftLocalAssetRepository>(
|
||||
(ref) => DriftLocalAssetRepository(ref.watch(driftProvider)),
|
||||
|
|
@ -19,9 +20,13 @@ final assetServiceProvider = Provider(
|
|||
),
|
||||
);
|
||||
|
||||
final placesProvider = FutureProvider<List<(String, String)>>(
|
||||
(ref) => AssetService(
|
||||
remoteAssetRepository: ref.watch(remoteAssetRepositoryProvider),
|
||||
localAssetRepository: ref.watch(localAssetRepository),
|
||||
).getPlaces(),
|
||||
);
|
||||
final placesProvider = FutureProvider<List<(String, String)>>((ref) {
|
||||
final assetService = ref.watch(assetServiceProvider);
|
||||
final auth = ref.watch(currentUserProvider);
|
||||
|
||||
if (auth == null) {
|
||||
return Future.value(const []);
|
||||
}
|
||||
|
||||
return assetService.getPlaces(auth.id);
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue