Merge branch 'master' into fix-create-pr-button

This commit is contained in:
Esteban Vega 2024-09-05 13:54:26 +02:00 committed by GitHub
commit 3c0f67300d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,20 +1,18 @@
<script lang="ts">
import { Code, isUserErrorCode } from '$lib/backend/ipc';
import { Code } from '$lib/backend/ipc';
import ProjectNotFound from '$lib/components/ProjectNotFound.svelte';
import SomethingWentWrong from '$lib/components/SomethingWentWrong.svelte';
import { page } from '$app/stores';
$: message = $page.error
? $page.error.message
: $page.status === 404
? 'Page not found'
: 'Unknown error';
const code = $derived($page.error?.errorCode);
const status = $derived($page.status);
const message = $derived($page.error?.message);
const error = $derived(message ? message : status === 404 ? 'Page not found' : 'Unknown error');
</script>
{#if isUserErrorCode($page.error?.errorCode)}
{#if $page.error?.errorCode === Code.ProjectMissing}
<ProjectNotFound />
{/if}
{#if code === Code.ProjectMissing}
<ProjectNotFound />
{:else}
<SomethingWentWrong error={message} />
<SomethingWentWrong {error} />
{/if}