mirror of
https://github.com/KevinMidboe/immich.git
synced 2025-10-29 17:40:28 +00:00
Migrate SvelteKit to the latest version 431 (#526)
This commit is contained in:
42
web/src/routes/+layout.svelte
Normal file
42
web/src/routes/+layout.svelte
Normal file
@@ -0,0 +1,42 @@
|
||||
<script lang="ts">
|
||||
import '../app.css';
|
||||
|
||||
import { fade } from 'svelte/transition';
|
||||
import DownloadPanel from '$lib/components/asset-viewer/download-panel.svelte';
|
||||
import AnnouncementBox from '$lib/components/shared-components/announcement-box.svelte';
|
||||
import UploadPanel from '$lib/components/shared-components/upload-panel.svelte';
|
||||
import { onMount } from 'svelte';
|
||||
import { checkAppVersion } from '$lib/utils/check-app-version';
|
||||
import { page } from '$app/stores';
|
||||
|
||||
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 $page.url}
|
||||
<div in:fade={{ duration: 100 }}>
|
||||
<slot />
|
||||
<DownloadPanel />
|
||||
|
||||
<UploadPanel />
|
||||
|
||||
{#if shouldShowAnnouncement}
|
||||
<AnnouncementBox
|
||||
{localVersion}
|
||||
{remoteVersion}
|
||||
on:close={() => (shouldShowAnnouncement = false)}
|
||||
/>
|
||||
{/if}
|
||||
</div>
|
||||
{/key}
|
||||
</main>
|
||||
Reference in New Issue
Block a user