mirror of
https://github.com/immich-app/immich.git
synced 2025-08-07 09:04:09 -04:00
fix: album leaving
This commit is contained in:
parent
a8a3151f8a
commit
c4c97a8152
@ -1753,6 +1753,7 @@
|
|||||||
"shared_album_activity_remove_title": "Delete Activity",
|
"shared_album_activity_remove_title": "Delete Activity",
|
||||||
"shared_album_section_people_action_error": "Error leaving/removing from album",
|
"shared_album_section_people_action_error": "Error leaving/removing from album",
|
||||||
"shared_album_section_people_action_leave": "Remove user from album",
|
"shared_album_section_people_action_leave": "Remove user from album",
|
||||||
|
"shared_album_section_people_action_leave_v2": "Leave album",
|
||||||
"shared_album_section_people_action_remove_user": "Remove user from album",
|
"shared_album_section_people_action_remove_user": "Remove user from album",
|
||||||
"shared_album_section_people_title": "PEOPLE",
|
"shared_album_section_people_title": "PEOPLE",
|
||||||
"shared_by": "Shared by",
|
"shared_by": "Shared by",
|
||||||
|
@ -48,7 +48,7 @@ class DriftAlbumOptionsPage extends HookConsumerWidget {
|
|||||||
void leaveAlbum() async {
|
void leaveAlbum() async {
|
||||||
try {
|
try {
|
||||||
await ref.read(remoteAlbumProvider.notifier).leaveAlbum(album.id, userId: userId);
|
await ref.read(remoteAlbumProvider.notifier).leaveAlbum(album.id, userId: userId);
|
||||||
context.navigateTo(const MainTimelineRoute(children: [DriftAlbumsRoute()]));
|
context.navigateTo(const DriftAlbumsRoute());
|
||||||
} catch (_) {
|
} catch (_) {
|
||||||
showErrorMessage();
|
showErrorMessage();
|
||||||
}
|
}
|
||||||
@ -58,7 +58,7 @@ class DriftAlbumOptionsPage extends HookConsumerWidget {
|
|||||||
try {
|
try {
|
||||||
await ref.read(remoteAlbumProvider.notifier).removeUser(album.id, user.id);
|
await ref.read(remoteAlbumProvider.notifier).removeUser(album.id, user.id);
|
||||||
ref.invalidate(remoteAlbumSharedUsersProvider(album.id));
|
ref.invalidate(remoteAlbumSharedUsersProvider(album.id));
|
||||||
} catch (error) {
|
} catch (_) {
|
||||||
showErrorMessage();
|
showErrorMessage();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -100,7 +100,7 @@ class DriftAlbumOptionsPage extends HookConsumerWidget {
|
|||||||
actions = [
|
actions = [
|
||||||
ListTile(
|
ListTile(
|
||||||
leading: const Icon(Icons.exit_to_app_rounded),
|
leading: const Icon(Icons.exit_to_app_rounded),
|
||||||
title: const Text("shared_album_section_people_action_leave").tr(),
|
title: const Text("shared_album_section_people_action_leave_v2").tr(),
|
||||||
onTap: leaveAlbum,
|
onTap: leaveAlbum,
|
||||||
),
|
),
|
||||||
];
|
];
|
||||||
|
@ -163,7 +163,11 @@ class RemoteAlbumNotifier extends Notifier<RemoteAlbumState> {
|
|||||||
|
|
||||||
Future<void> leaveAlbum(String albumId, {required String userId}) async {
|
Future<void> leaveAlbum(String albumId, {required String userId}) async {
|
||||||
await _remoteAlbumService.removeUser(albumId, userId: userId);
|
await _remoteAlbumService.removeUser(albumId, userId: userId);
|
||||||
await deleteAlbum(albumId);
|
|
||||||
|
final updatedAlbums = state.albums.where((album) => album.id != albumId).toList();
|
||||||
|
final updatedFilteredAlbums = state.filteredAlbums.where((album) => album.id != albumId).toList();
|
||||||
|
|
||||||
|
state = state.copyWith(albums: updatedAlbums, filteredAlbums: updatedFilteredAlbums);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> setActivityStatus(String albumId, bool enabled) {
|
Future<void> setActivityStatus(String albumId, bool enabled) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user