mirror of
https://github.com/immich-app/immich.git
synced 2025-12-23 01:11:36 +03:00
feat(mobile): include partner's photos on map (#8553)
* add option for showing partner images on the map * renaming of iswithPartners variable
This commit is contained in:
@@ -12,6 +12,7 @@ Future<List<MapMarker>> mapMarkers(MapMarkersRef ref) async {
|
||||
DateTime? fileCreatedAfter;
|
||||
bool? isFavorite;
|
||||
bool? isIncludeArchived;
|
||||
bool? isWithPartners;
|
||||
|
||||
if (mapState.relativeTime != 0) {
|
||||
fileCreatedAfter =
|
||||
@@ -26,9 +27,14 @@ Future<List<MapMarker>> mapMarkers(MapMarkersRef ref) async {
|
||||
isIncludeArchived = false;
|
||||
}
|
||||
|
||||
if (mapState.withPartners) {
|
||||
isWithPartners = true;
|
||||
}
|
||||
|
||||
final markers = await service.getMapMarkers(
|
||||
isFavorite: isFavorite,
|
||||
withArchived: isIncludeArchived,
|
||||
withPartners: isWithPartners,
|
||||
fileCreatedAfter: fileCreatedAfter,
|
||||
);
|
||||
|
||||
|
||||
@@ -30,6 +30,8 @@ class MapStateNotifier extends _$MapStateNotifier {
|
||||
.getSetting<bool>(AppSettingsEnum.mapShowFavoriteOnly),
|
||||
includeArchived: appSettingsProvider
|
||||
.getSetting<bool>(AppSettingsEnum.mapIncludeArchived),
|
||||
withPartners: appSettingsProvider
|
||||
.getSetting<bool>(AppSettingsEnum.mapwithPartners),
|
||||
relativeTime:
|
||||
appSettingsProvider.getSetting<int>(AppSettingsEnum.mapRelativeDate),
|
||||
);
|
||||
@@ -114,6 +116,7 @@ class MapStateNotifier extends _$MapStateNotifier {
|
||||
state = state.copyWith(shouldRefetchMarkers: shouldRefetch);
|
||||
}
|
||||
|
||||
|
||||
void switchIncludeArchived(bool isIncludeArchived) {
|
||||
ref.read(appSettingsServiceProvider).setSetting(
|
||||
AppSettingsEnum.mapIncludeArchived,
|
||||
@@ -125,6 +128,17 @@ class MapStateNotifier extends _$MapStateNotifier {
|
||||
);
|
||||
}
|
||||
|
||||
void switchWithPartners(bool isWithPartners) {
|
||||
ref.read(appSettingsServiceProvider).setSetting(
|
||||
AppSettingsEnum.mapwithPartners,
|
||||
isWithPartners,
|
||||
);
|
||||
state = state.copyWith(
|
||||
withPartners: isWithPartners,
|
||||
shouldRefetchMarkers: true,
|
||||
);
|
||||
}
|
||||
|
||||
void setRelativeTime(int relativeTime) {
|
||||
ref.read(appSettingsServiceProvider).setSetting(
|
||||
AppSettingsEnum.mapRelativeDate,
|
||||
|
||||
Reference in New Issue
Block a user