Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions immichFrame.Web/src/lib/components/elements/error-element.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@
}

let { message = '', authError: authError = false }: Props = $props();
let retryMessage = $derived(
!authError
? 'The page will automatically refresh every 30 seconds until a connection is re-established.'
: ''
);
</script>

<div
Expand Down Expand Up @@ -52,8 +57,12 @@
</p>
{:else}
<p>
Looks like your immich-server is offline or you misconfigured immichFrame, check the
container logs
{message ||
'Looks like your immich-server is offline or you misconfigured immichFrame. Check the container logs.'}
</p>

<p class="text-lg mt-6 opacity-60 animate-pulse">
{retryMessage}
</p>
{/if}
</div>
Expand Down
8 changes: 8 additions & 0 deletions immichFrame.Web/src/lib/components/home-page/home-page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@

let unsubscribeRestart: () => void;
let unsubscribeStop: () => void;
let refreshInterval: number;

let cursorVisible = $state(true);
let timeoutId: number;
Expand Down Expand Up @@ -387,6 +388,12 @@
onMount(() => {
window.addEventListener('mousemove', showCursor);
window.addEventListener('click', showCursor);

// 30 second reload on error
refreshInterval = window.setInterval(() => {
if (error) window.location.reload();
}, 30000);

if ($configStore.primaryColor) {
document.documentElement.style.setProperty('--primary-color', $configStore.primaryColor);
}
Expand Down Expand Up @@ -418,6 +425,7 @@
return () => {
window.removeEventListener('mousemove', showCursor);
window.removeEventListener('click', showCursor);
window.clearInterval(refreshInterval);
};
});

Expand Down
Loading