From 3d524d21404028486c9fe240ee1829c87b01ee69 Mon Sep 17 00:00:00 2001 From: Alex Date: Thu, 10 Oct 2024 15:46:09 +0700 Subject: [PATCH] format fix --- .../album-page/album-options.svelte | 95 ++++++++++--------- .../[[assetId=id]]/+page.svelte | 30 +++--- 2 files changed, 62 insertions(+), 63 deletions(-) diff --git a/web/src/lib/components/album-page/album-options.svelte b/web/src/lib/components/album-page/album-options.svelte index dd2d601338e75..53fd355c4b0db 100644 --- a/web/src/lib/components/album-page/album-options.svelte +++ b/web/src/lib/components/album-page/album-options.svelte @@ -5,7 +5,7 @@ removeUserFromAlbum, type AlbumResponseDto, type UserResponseDto, - AssetOrder + AssetOrder, } from '@immich/sdk'; import { mdiArrowDownThin, mdiArrowUpThin, mdiPlus, mdiDotsVertical } from '@mdi/js'; import FullScreenModal from '$lib/components/shared-components/full-screen-modal.svelte'; @@ -83,62 +83,63 @@ {#if !selectedRemoveUser} - -
-
-

{$t('settings').toUpperCase()}

-
- {#if order} - +
+
+

{$t('settings').toUpperCase()}

+
+ {#if order} + + {/if} + - {/if} - -
-
-
-
{$t('people').toUpperCase()}
-
- - -
-
- -
-
{user.name}
-
{$t('owner')}
+
+
+
{$t('people').toUpperCase()}
+
+ - {#each album.albumUsers as { user } (user.id)} -
+
{user.name}
- {#if user.id !== album.ownerId} - - handleMenuRemove(user)} text={$t('remove')} /> - - {/if} +
{$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} 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 b2b628be1854b..fdf21a2bb82cd 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 @@ -346,22 +346,20 @@ }; const handleRemoveUser = async (userId: string, nextViewMode: ViewMode) => { - if (userId == 'me' || userId === $user.id) { - await goto(backUrl); - return; - } - - try { - await refreshAlbum(); - - // Dynamically set the view mode based on the passed argument - viewMode = album.albumUsers.length > 0 ? nextViewMode : ViewMode.VIEW; + if (userId == 'me' || userId === $user.id) { + await goto(backUrl); + return; + } - } catch (error) { - handleError(error, $t('errors.error_deleting_shared_user')); - } -}; + try { + await refreshAlbum(); + // 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')); + } + }; const handleDownloadAlbum = async () => { await downloadAlbum(album); @@ -734,7 +732,7 @@ (viewMode = ViewMode.VIEW)} {album} - onRemove={(userId) => handleRemoveUser(userId, ViewMode.VIEW_USERS)} + onRemove={(userId) => handleRemoveUser(userId, ViewMode.VIEW_USERS)} onRefreshAlbum={refreshAlbum} /> {/if} @@ -748,7 +746,7 @@ albumOrder = order; await setModeToView(); }} - onRemove={(userId)=>handleRemoveUser(userId, ViewMode.OPTIONS)} + onRemove={(userId) => handleRemoveUser(userId, ViewMode.OPTIONS)} onClose={() => (viewMode = ViewMode.VIEW)} onToggleEnabledActivity={handleToggleEnableActivity} onShowSelectSharedUser={() => (viewMode = ViewMode.SELECT_USERS)}