Remove AuthenticationError component

This commit is contained in:
Sebastian Martinez
2025-03-18 21:21:02 +01:00
parent c730e82187
commit 738e7f4fb4
4 changed files with 1 additions and 66 deletions
-6
View File
@@ -14,7 +14,6 @@
import { theme } from "@app/components/ThemeSwitch.svelte";
import { unreachable } from "@app/lib/utils";
import AuthenticationError from "@app/views/AuthenticationError.svelte";
import CreateIssue from "@app/views/repo/CreateIssue.svelte";
import Inbox from "./views/home/Inbox.svelte";
import Issue from "@app/views/repo/Issue.svelte";
@@ -93,10 +92,7 @@
</script>
{#if $activeRouteStore.resource === "booting"}
{#if error && typeof error === "object" && "err" in error && typeof error.err === "string"}
<AuthenticationError error={error.err} />
{/if}
<!-- Don't show anything -->
{:else if $activeRouteStore.resource === "home"}
<Repos {...$activeRouteStore.params} />
{:else if $activeRouteStore.resource === "inbox"}
@@ -111,8 +107,6 @@
<Patch {...$activeRouteStore.params} />
{:else if $activeRouteStore.resource === "repo.patches"}
<Patches {...$activeRouteStore.params} />
{:else if $activeRouteStore.resource === "authenticationError"}
<AuthenticationError {...$activeRouteStore.params} />
{:else}
{unreachable($activeRouteStore)}
{/if}
-5
View File
@@ -113,9 +113,6 @@ function urlToRoute(url: URL): Route | null {
case "repos": {
return repoUrlToRoute(segments, url.searchParams);
}
case "authenticationError": {
return { resource: "authenticationError", params: { error: "" } };
}
default: {
return null;
}
@@ -127,8 +124,6 @@ export function routeToPath(route: Route): string {
return "/";
} else if (route.resource === "inbox") {
return "/inbox";
} else if (route.resource === "authenticationError") {
return "/authenticationError";
} else if (
route.resource === "repo.createIssue" ||
route.resource === "repo.issue" ||
+1 -15
View File
@@ -29,14 +29,6 @@ interface BootingRoute {
resource: "booting";
}
interface AuthenticationErrorRoute {
resource: "authenticationError";
params: {
error: string;
hint?: string;
};
}
interface HomeRoute {
resource: "home";
activeTab?: HomeReposTab;
@@ -76,15 +68,9 @@ interface LoadedHomeRoute {
};
}
export type Route =
| AuthenticationErrorRoute
| InboxRoute
| BootingRoute
| HomeRoute
| RepoRoute;
export type Route = InboxRoute | BootingRoute | HomeRoute | RepoRoute;
export type LoadedRoute =
| AuthenticationErrorRoute
| LoadedInboxRoute
| BootingRoute
| LoadedHomeRoute
-40
View File
@@ -1,40 +0,0 @@
<script lang="ts">
import Icon from "@app/components/Icon.svelte";
interface Props {
error: string;
hint?: string;
}
const { error, hint }: Props = $props();
</script>
<style>
main {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
height: 100%;
width: 100%;
row-gap: 0.5rem;
}
/* This tag comes from the backend. */
:global(code) {
font-family: var(--font-family-monospace);
font-size: var(--font-size-small);
background-color: var(--color-fill-ghost);
padding: 0.125rem 0.25rem;
}
</style>
<main>
<Icon name="warning" size="32" />
<div class="txt-medium txt-semibold">
{error}
</div>
{#if hint}
<div class="txt-small">{@html hint}</div>
{/if}
</main>