mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-11-28 17:50:28 +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
@@ -4,7 +4,12 @@
|
||||
import debounce from "lodash/debounce";
|
||||
|
||||
import { writeToClipboard } from "@app/lib/invoke";
|
||||
import { didFromPublicKey, explorerUrl, truncateDid } from "@app/lib/utils";
|
||||
import {
|
||||
didFromPublicKey,
|
||||
explorerHost,
|
||||
explorerUrl,
|
||||
truncateDid,
|
||||
} from "@app/lib/utils";
|
||||
|
||||
import Button from "@app/components/Button.svelte";
|
||||
import DropdownListItem from "@app/components/DropdownListItem.svelte";
|
||||
@@ -60,11 +65,14 @@
|
||||
style:text-decoration="none"
|
||||
style:width="100%"
|
||||
onclick={closeFocused}
|
||||
href={explorerUrl(`users/${didFromPublicKey(config.publicKey)}`)}
|
||||
href={explorerUrl(
|
||||
`users/${didFromPublicKey(config.publicKey)}`,
|
||||
config,
|
||||
)}
|
||||
target="_blank">
|
||||
<DropdownListItem styleGap="0.5rem" styleWidth="100%" selected={false}>
|
||||
<Icon name="seed" />
|
||||
view on iris.radicle.network
|
||||
Open in {explorerHost(config)}
|
||||
<span style:margin-left="auto"><Icon name="open-external" /></span>
|
||||
</DropdownListItem>
|
||||
</a>
|
||||
|
||||
Reference in New Issue
Block a user