Radish alpha
r
rad:z4D5UCArafTzTQpDZNQRuqswh3ury
Radicle desktop app
Radicle
Git
Remove `AuthenticationError` component
Sebastian Martinez committed 1 year ago
commit 738e7f4fb48dbef487f41cef4652e3f24d891ae3
parent c730e82
4 files changed +1 -66
modified src/App.svelte
@@ -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}
modified src/lib/router.ts
@@ -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" ||
modified src/lib/router/definitions.ts
@@ -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
deleted src/views/AuthenticationError.svelte
@@ -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>