mirror of
https://github.com/gitbutlerapp/gitbutler.git
synced 2024-12-25 18:49:11 +03:00
Merge branch 'master' into fix-create-pr-button
This commit is contained in:
commit
3c0f67300d
@ -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}
|
||||
|
Loading…
Reference in New Issue
Block a user