mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-11-21 06:10:44 +08:00
Refactor BaseUrl string conversion
We're only using this as a string, so no need to convert it to an URL.
This commit is contained in:
@@ -509,9 +509,9 @@
|
||||
style:border-radius="var(--border-radius-small">
|
||||
<ErrorMessage
|
||||
title="Failed to load diff for this revision"
|
||||
description="Make sure you are able to connect to the seed <code>${utils
|
||||
.baseUrlToUrl(api.baseUrl)
|
||||
.toString()}</code>"
|
||||
description="Make sure you are able to connect to the seed <code>${utils.baseUrlToString(
|
||||
api.baseUrl,
|
||||
)}</code>"
|
||||
{error} />
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
import { COMMITS_PER_PAGE } from "./router";
|
||||
import { HttpdClient } from "@httpd-client";
|
||||
import { baseUrlToUrl } from "@app/lib/utils";
|
||||
import { baseUrlToString } from "@app/lib/utils";
|
||||
import { groupCommits } from "@app/lib/commit";
|
||||
|
||||
import Button from "@app/components/Button.svelte";
|
||||
@@ -160,9 +160,9 @@
|
||||
<div class="message">
|
||||
<ErrorMessage
|
||||
title="Couldn't load commits"
|
||||
description="Make sure you are able to connect to the seed <code>${baseUrlToUrl(
|
||||
description="Make sure you are able to connect to the seed <code>${baseUrlToString(
|
||||
api.baseUrl,
|
||||
).toString()}</code>"
|
||||
)}</code>"
|
||||
{error} />
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
import { ISSUES_PER_PAGE } from "./router";
|
||||
import { closeFocused } from "@app/components/Popover.svelte";
|
||||
import { httpdStore } from "@app/lib/httpd";
|
||||
import { baseUrlToUrl, isLocal } from "@app/lib/utils";
|
||||
import { baseUrlToString, isLocal } from "@app/lib/utils";
|
||||
import capitalize from "lodash/capitalize";
|
||||
|
||||
import Button from "@app/components/Button.svelte";
|
||||
@@ -176,9 +176,9 @@
|
||||
{#if error}
|
||||
<ErrorMessage
|
||||
title="Couldn't load issues"
|
||||
description="Please make sure you are able to connect to the seed <code>${baseUrlToUrl(
|
||||
description="Please make sure you are able to connect to the seed <code>${baseUrlToString(
|
||||
api.baseUrl,
|
||||
).toString()}</code>"
|
||||
)}</code>"
|
||||
{error} />
|
||||
{/if}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
import { PATCHES_PER_PAGE } from "./router";
|
||||
import { httpdStore } from "@app/lib/httpd";
|
||||
import { baseUrlToUrl, isLocal } from "@app/lib/utils";
|
||||
import { baseUrlToString, isLocal } from "@app/lib/utils";
|
||||
|
||||
import Button from "@app/components/Button.svelte";
|
||||
import DropdownList from "@app/components/DropdownList.svelte";
|
||||
@@ -195,9 +195,9 @@
|
||||
{#if error}
|
||||
<ErrorMessage
|
||||
title="Couldn't load patches"
|
||||
description="Please make sure you are able to connect to the seed <code>${baseUrlToUrl(
|
||||
description="Please make sure you are able to connect to the seed <code>${baseUrlToString(
|
||||
api.baseUrl,
|
||||
).toString()}</code>"
|
||||
)}</code>"
|
||||
{error} />
|
||||
{/if}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { ErrorRoute, NotFoundRoute } from "@app/lib/router/definitions";
|
||||
import type { ProjectRoute } from "@app/views/projects/router";
|
||||
|
||||
import { baseUrlToUrl, isLocal } from "@app/lib/utils";
|
||||
import { baseUrlToString, isLocal } from "@app/lib/utils";
|
||||
import { ResponseParseError, ResponseError } from "@httpd-client/lib/fetcher";
|
||||
import { httpdStore } from "@app/lib/httpd";
|
||||
import { get } from "svelte/store";
|
||||
@@ -10,7 +10,7 @@ export function handleError(
|
||||
error: Error | ResponseParseError | ResponseError,
|
||||
route: ProjectRoute,
|
||||
): NotFoundRoute | ErrorRoute {
|
||||
const url = baseUrlToUrl(route.node);
|
||||
const url = baseUrlToString(route.node);
|
||||
if (error instanceof ResponseError && error.status === 404) {
|
||||
let subject;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user