Fix add relay

This commit is contained in:
Jonathan Staab 2023-02-08 14:58:29 -06:00
parent 1dfad47396
commit c1569a3903
3 changed files with 4 additions and 4 deletions

View File

@ -44,9 +44,9 @@ export const login = async ({privkey, pubkey}: {privkey?: string, pubkey?: strin
navigate('/notes/network')
}
export const addRelay = async relay => {
export const addRelay = async url => {
const person = get(user)
const modify = relays => relays.concat(relay)
const modify = relays => relays.concat({url, write: '!'})
// Set to defaults to support anonymous usage
defaults.relays = modify(defaults.relays)

View File

@ -63,7 +63,7 @@
{/if}
</div>
{#if joined}
<button class="flex gap-3 items-center text-light" on:click={() => removeRelay(relay.url)}>
<button class="flex gap-3 items-center text-light" on:click={() => removeRelay(relay)}>
<i class="fa fa-right-from-bracket" /> Leave
</button>
{:else}

View File

@ -26,7 +26,7 @@
return toast.show("error", "That isn't a valid websocket url")
}
addRelay({url})
addRelay(url)
modal.set(null)
}
</script>