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_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_v2": "Leave album",
|
||||
"shared_album_section_people_action_remove_user": "Remove user from album",
|
||||
"shared_album_section_people_title": "PEOPLE",
|
||||
"shared_by": "Shared by",
|
||||
|
@ -48,7 +48,7 @@ class DriftAlbumOptionsPage extends HookConsumerWidget {
|
||||
void leaveAlbum() async {
|
||||
try {
|
||||
await ref.read(remoteAlbumProvider.notifier).leaveAlbum(album.id, userId: userId);
|
||||
context.navigateTo(const MainTimelineRoute(children: [DriftAlbumsRoute()]));
|
||||
context.navigateTo(const DriftAlbumsRoute());
|
||||
} catch (_) {
|
||||
showErrorMessage();
|
||||
}
|
||||
@ -58,7 +58,7 @@ class DriftAlbumOptionsPage extends HookConsumerWidget {
|
||||
try {
|
||||
await ref.read(remoteAlbumProvider.notifier).removeUser(album.id, user.id);
|
||||
ref.invalidate(remoteAlbumSharedUsersProvider(album.id));
|
||||
} catch (error) {
|
||||
} catch (_) {
|
||||
showErrorMessage();
|
||||
}
|
||||
|
||||
@ -100,7 +100,7 @@ class DriftAlbumOptionsPage extends HookConsumerWidget {
|
||||
actions = [
|
||||
ListTile(
|
||||
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,
|
||||
),
|
||||
];
|
||||
|
@ -163,7 +163,11 @@ class RemoteAlbumNotifier extends Notifier<RemoteAlbumState> {
|
||||
|
||||
Future<void> leaveAlbum(String albumId, {required String userId}) async {
|
||||
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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user