mirror of
https://seed.radicle.dev/rad:z4D5UCArafTzTQpDZNQRuqswh3ury.git
synced 2026-11-29 14:50:34 +08:00
Use configured explorer and seed for links
explorerUrl() hardcoded both the seed ("iris.radicle.network") and
the explorer base ("https://radicle.network"), so every "Copy Link"
and "Open in …" action ignored the user's config and could point at
a host that does not replicate the repo.
Expose publicExplorer and preferredSeeds on the Config type (both
already carried by radicle::profile::Config) and thread config
through to every explorerUrl() call site. URLs are now built from
the publicExplorer template, filling $host from the first preferred
seed (falling back to rosa only when none are configured), and link
labels show the configured explorer's host.
Co-authored-by: Rūdolfs Ošiņš <rudolfs@osins.org>
This commit is contained in:
co-authored by
Rūdolfs Ošiņš
parent
7fe26dc4e5
commit
74aaa6ef14
@@ -1,4 +1,5 @@
|
||||
<script lang="ts">
|
||||
import type { Config } from "@bindings/config/Config";
|
||||
import type { RepoInfo } from "@bindings/repo/RepoInfo";
|
||||
|
||||
import debounce from "lodash/debounce";
|
||||
@@ -15,9 +16,10 @@
|
||||
|
||||
interface Props {
|
||||
repo: RepoInfo;
|
||||
config: Config;
|
||||
}
|
||||
|
||||
const { repo }: Props = $props();
|
||||
const { repo, config }: Props = $props();
|
||||
|
||||
const project = $derived(repo.payloads["xyz.radicle.project"]!);
|
||||
|
||||
@@ -27,7 +29,7 @@
|
||||
}, 1000);
|
||||
|
||||
async function copyLink() {
|
||||
await writeToClipboard(explorerUrl(repo.rid));
|
||||
await writeToClipboard(explorerUrl(repo.rid, config));
|
||||
copyIcon = "checkmark";
|
||||
restoreCopyIcon();
|
||||
}
|
||||
@@ -131,7 +133,7 @@
|
||||
style:white-space="nowrap"
|
||||
style:text-decoration="none"
|
||||
style:width="100%"
|
||||
href={explorerUrl(`users/${delegate.did}`)}
|
||||
href={explorerUrl(`users/${delegate.did}`, config)}
|
||||
target="_blank">
|
||||
{#if delegate.alias}
|
||||
<span class="txt-overflow alias">
|
||||
|
||||
Reference in New Issue
Block a user