Radish alpha
r
Radicle web interface
Radicle
Git (anonymous pull)
Log in to clone via SSH
By default, use new seed format
Alexis Sellier committed 4 years ago
commit 66955f92dda82e5b0045af5312f1e8f1bcd9c141
parent aec7307af891623a879cdfef7b92092792d11137
2 files changed +13 -6
modified src/SeedAddress.spec.ts
@@ -13,8 +13,7 @@ describe('SeedAddress', function () {
        port: 8776
      }
    }, styles);
-
    cy.findByText("hydkkk…coygh1@seed.cloudhead.io").should("exist").should("have.attr", "href", "/seeds/seed.cloudhead.io");
-
    cy.findByText(":8776").should("exist");
+
    cy.findByText("seed.cloudhead.io").should("exist").should("have.attr", "href", "/seeds/seed.cloudhead.io");
    cy.findByText("Copy").should("exist");
  });

@@ -22,7 +21,7 @@ describe('SeedAddress', function () {
    cy.findByText("Copy").click().should("exist");
    cy.findByText("Copy ✓").should("have.attr", "disabled");
    // We invoke the cy.window here since doing the clipboard action in the runner window, would throw an error
-
    cy.window().its("navigator.clipboard").invoke("readText").should("equal", "hydkkkf5ksbe5fuszdhpqhytu3q36gwagj874wxwpo5a8ti8coygh1@seed.cloudhead.io:8776");
+
    cy.window().its("navigator.clipboard").invoke("readText").should("equal", "seed.cloudhead.io");
    cy.wait(4000);
    cy.findByText("Copy").click().should("exist").should("not.have.attr", "disabled");
  });
modified src/SeedAddress.svelte
@@ -4,11 +4,15 @@

  export let seed: Seed;
  export let port: number;
+
  export let full = false;

  let seedCopied = false;

  const copySeed = (seedId: string, seedHost: string) => {
-
    return () => toClipboard(formatSeedAddress(seedId, seedHost, port)).then(() => {
+
    const str = full
+
      ? formatSeedAddress(seedId, seedHost, port)
+
      : seedHost;
+
    return () => toClipboard(str).then(() => {
      seedCopied = true;
      setTimeout(() => {
        seedCopied = false;
@@ -38,8 +42,12 @@
<div class="desktop">
  <div class="seed-address">
    <span class="seed-icon">🌱</span>
-
    <span><a href="/seeds/{seed.host}" class="link">{formatSeedId(seed.id)}@{seed.host}</a></span>
-
    <span class="faded">:{port}</span>
+
    {#if full}
+
      <span><a href="/seeds/{seed.host}" class="link">{formatSeedId(seed.id)}@{seed.host}</a></span>
+
      <span class="faded">:{port}</span>
+
    {:else}
+
      <span><a href="/seeds/{seed.host}" class="link">{seed.host}</a></span>
+
    {/if}
  </div>
</div>
<div>