Add contact info to relay detail

This commit is contained in:
Jonathan Staab 2023-02-23 16:59:58 -06:00
parent 9ee96c45d7
commit 040e8955de
3 changed files with 29 additions and 22 deletions

View File

@ -1,10 +1,7 @@
# Current # Current
- [ ] Add messages to database after visiting a chat/dm detail *shrugs shoulders* - [ ] Fix pagination
- [ ] Move non-partials to pod file structure - [ ] Relays get marked as slow too easily now
- [ ] Await publish, show error if it fails or times out
- Show loading
- [ ] Test chat/dms
# Next # Next

View File

@ -295,10 +295,10 @@ const verifyNip05 = (pubkey, as) =>
) )
database.routes.bulkPut( database.routes.bulkPut(
createMap('id', urls.flatMap(url =>[ createMap('id', urls.flatMap(url => [
calculateRoute(pubkey, url, 'nip05', 'write', now()), calculateRoute(pubkey, url, 'nip05', 'write', now()),
calculateRoute(pubkey, url, 'nip05', 'read', now()), calculateRoute(pubkey, url, 'nip05', 'read', now()),
])) ]).filter(identity))
) )
} }
} }

View File

@ -4,6 +4,7 @@
import {poll} from "src/util/misc" import {poll} from "src/util/misc"
import {between} from 'hurdak/lib/hurdak' import {between} from 'hurdak/lib/hurdak'
import Content from "src/partials/Content.svelte" import Content from "src/partials/Content.svelte"
import Anchor from "src/partials/Anchor.svelte"
import Feed from "src/views/notes/Feed.svelte" import Feed from "src/views/notes/Feed.svelte"
import database from 'src/agent/database' import database from 'src/agent/database'
import pool from 'src/agent/pool' import pool from 'src/agent/pool'
@ -57,21 +58,30 @@
{message} {message}
</p> </p>
</div> </div>
{#if joined} <div class="whitespace-nowrap flex gap-3 items-center flex-wrap">
{#if $relays.length > 1} {#if relay.contact}
<button <Anchor type="button-circle" href={`mailto:${relay.contact}`}>
class="flex gap-3 items-center text-light" <i class="fa fa-envelope" />
on:click={() => user.removeRelay(relay.url)}> </Anchor>
<i class="fa fa-right-from-bracket" /> Leave {/if}
</button> {#if joined}
{/if} {#if $relays.length > 1}
{:else} <Anchor
<button type="button"
class="flex gap-3 items-center text-light" class="flex gap-2 items-center rounded-full"
on:click={() => user.addRelay(relay.url)}> on:click={() => user.removeRelay(relay.url)}>
<i class="fa fa-right-to-bracket" /> Join <i class="fa fa-right-from-bracket" /> Leave
</button> </Anchor>
{/if} {/if}
{:else}
<Anchor
type="button"
class="flex gap-2 items-center rounded-full"
on:click={() => user.addRelay(relay.url)}>
<i class="fa fa-right-to-bracket" /> Join
</Anchor>
{/if}
</div>
</div> </div>
{#if relay.description} {#if relay.description}
<p>{relay.description}</p> <p>{relay.description}</p>