mirror of
https://github.com/immich-app/immich.git
synced 2025-12-20 17:25:35 +03:00
* Added album page * Refactor sidebar * Added album assets count info * Added album viewer page * Refactor album sorting * Fixed incorrectly showing selected asset in album selection * Improve fetching speed with prefetch * Refactor to use ImmichThubmnail component for all * Update to the latest version of Svelte * Implement fixed app bar in album viewer * Added shared user avatar * Correctly get all owned albums, including shared
53 lines
1.3 KiB
Svelte
53 lines
1.3 KiB
Svelte
<script context="module" lang="ts">
|
|
import type { Load } from '@sveltejs/kit';
|
|
import { checkAppVersion } from '$lib/utils/check-app-version';
|
|
|
|
export const load: Load = async ({ url, session }) => {
|
|
if (session.user) {
|
|
api.setAccessToken(session.user.accessToken);
|
|
}
|
|
|
|
return {
|
|
props: { url },
|
|
};
|
|
};
|
|
</script>
|
|
|
|
<script lang="ts">
|
|
import '../app.css';
|
|
|
|
import { blur, fade, slide } from 'svelte/transition';
|
|
|
|
import DownloadPanel from '$lib/components/asset-viewer/download-panel.svelte';
|
|
import AnnouncementBox from '$lib/components/shared/announcement-box.svelte';
|
|
import UploadPanel from '$lib/components/shared/upload-panel.svelte';
|
|
import { onMount } from 'svelte';
|
|
import { api } from '@api';
|
|
|
|
export let url: string;
|
|
let shouldShowAnnouncement: boolean;
|
|
let localVersion: string;
|
|
let remoteVersion: string;
|
|
|
|
onMount(async () => {
|
|
const res = await checkAppVersion();
|
|
|
|
shouldShowAnnouncement = res.shouldShowAnnouncement;
|
|
localVersion = res.localVersion ?? 'unknown';
|
|
remoteVersion = res.remoteVersion ?? 'unknown';
|
|
});
|
|
</script>
|
|
|
|
<main>
|
|
{#key url}
|
|
<div in:fade={{ duration: 100 }}>
|
|
<slot />
|
|
<DownloadPanel />
|
|
<UploadPanel />
|
|
{#if shouldShowAnnouncement}
|
|
<AnnouncementBox {localVersion} {remoteVersion} on:close={() => (shouldShowAnnouncement = false)} />
|
|
{/if}
|
|
</div>
|
|
{/key}
|
|
</main>
|