mirror of
https://github.com/immich-app/immich.git
synced 2025-12-29 17:25:00 +03:00
fix: flash bug on tag (#12332)
* fix flash bug on tag * fix lint --------- Co-authored-by: Alex <alex.tran1502@gmail.com>
This commit is contained in:
@@ -40,10 +40,16 @@
|
||||
return Object.fromEntries(tags.map((tag) => [tag.value, tag]));
|
||||
};
|
||||
|
||||
const assetStore = new AssetStore({});
|
||||
|
||||
$: tags = data.tags;
|
||||
$: tagsMap = buildMap(tags);
|
||||
$: tag = currentPath ? tagsMap[currentPath] : null;
|
||||
$: tagId = tag?.id;
|
||||
$: tree = buildTree(tags.map((tag) => tag.value));
|
||||
$: {
|
||||
void assetStore.updateOptions({ tagId });
|
||||
}
|
||||
|
||||
const handleNavigation = async (tag: string) => {
|
||||
await navigateToView(normalizeTreePath(`${data.path || ''}/${tag}`));
|
||||
@@ -169,20 +175,13 @@
|
||||
<Breadcrumbs {pathSegments} icon={mdiTagMultiple} title={$t('tags')} {getLink} />
|
||||
|
||||
<section class="mt-2 h-full">
|
||||
{#key $page.url.href}
|
||||
{#if tag}
|
||||
<AssetGrid
|
||||
enableRouting={true}
|
||||
assetStore={new AssetStore({ tagId: tag.id })}
|
||||
{assetInteractionStore}
|
||||
removeAction={AssetAction.UNARCHIVE}
|
||||
>
|
||||
<TreeItemThumbnails items={data.children} icon={mdiTag} onClick={handleNavigation} slot="empty" />
|
||||
</AssetGrid>
|
||||
{:else}
|
||||
<TreeItemThumbnails items={Object.keys(tree)} icon={mdiTag} onClick={handleNavigation} />
|
||||
{/if}
|
||||
{/key}
|
||||
{#if tag}
|
||||
<AssetGrid enableRouting={true} {assetStore} {assetInteractionStore} removeAction={AssetAction.UNARCHIVE}>
|
||||
<TreeItemThumbnails items={data.children} icon={mdiTag} onClick={handleNavigation} slot="empty" />
|
||||
</AssetGrid>
|
||||
{:else}
|
||||
<TreeItemThumbnails items={Object.keys(tree)} icon={mdiTag} onClick={handleNavigation} />
|
||||
{/if}
|
||||
</section>
|
||||
</UserPageLayout>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user