+
+
{$t('settings').toUpperCase()}
+
+ {#if order}
+
+ {/if}
+
- {/if}
-
-
-
-
-
{$t('people').toUpperCase()}
-
-
-
-
-
-
-
{user.name}
-
{$t('owner')}
- {#each album.albumUsers as { user } (user.id)}
-
+
+
+
{$t('people').toUpperCase()}
+
+
+
+
{user.name}
+
{$t('owner')}
- {/each}
+
+ {#each album.albumUsers as { user } (user.id)}
+
+
+
+
+
{user.name}
+ {#if user.id !== album.ownerId}
+
+
+ handleMenuRemove(user)} text={$t('remove')} />
+
+ {/if}
+
+ {/each}
+
-
-
+
+{/if}
+
+{#if selectedRemoveUser}
+
(selectedRemoveUser = null)}
+ />
+{/if}
diff --git a/web/src/routes/(user)/albums/[albumId=id]/[[photos=photos]]/[[assetId=id]]/+page.svelte b/web/src/routes/(user)/albums/[albumId=id]/[[photos=photos]]/[[assetId=id]]/+page.svelte
index 3df4a25b83..fdf21a2bb8 100644
--- a/web/src/routes/(user)/albums/[albumId=id]/[[photos=photos]]/[[assetId=id]]/+page.svelte
+++ b/web/src/routes/(user)/albums/[albumId=id]/[[photos=photos]]/[[assetId=id]]/+page.svelte
@@ -345,7 +345,7 @@
}
};
- const handleRemoveUser = async (userId: string) => {
+ const handleRemoveUser = async (userId: string, nextViewMode: ViewMode) => {
if (userId == 'me' || userId === $user.id) {
await goto(backUrl);
return;
@@ -353,7 +353,9 @@
try {
await refreshAlbum();
- viewMode = album.albumUsers.length > 0 ? ViewMode.VIEW_USERS : ViewMode.VIEW;
+
+ // Dynamically set the view mode based on the passed argument
+ viewMode = album.albumUsers.length > 0 ? nextViewMode : ViewMode.VIEW;
} catch (error) {
handleError(error, $t('errors.error_deleting_shared_user'));
}
@@ -730,7 +732,7 @@
(viewMode = ViewMode.VIEW)}
{album}
- onRemove={handleRemoveUser}
+ onRemove={(userId) => handleRemoveUser(userId, ViewMode.VIEW_USERS)}
onRefreshAlbum={refreshAlbum}
/>
{/if}
@@ -744,6 +746,7 @@
albumOrder = order;
await setModeToView();
}}
+ onRemove={(userId) => handleRemoveUser(userId, ViewMode.OPTIONS)}
onClose={() => (viewMode = ViewMode.VIEW)}
onToggleEnabledActivity={handleToggleEnableActivity}
onShowSelectSharedUser={() => (viewMode = ViewMode.SELECT_USERS)}