forked from coracle/flotilla
Switch wording to messaging from inbox
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
BLOSSOM_SERVERS,
|
||||
} from "@welshman/util"
|
||||
import {Router} from "@welshman/router"
|
||||
import {userMutes, tagPubkey, publishThunk, userBlossomServers} from "@welshman/app"
|
||||
import {userMuteList, tagPubkey, publishThunk, userBlossomServerList} from "@welshman/app"
|
||||
import {preventDefault} from "@lib/html"
|
||||
import Field from "@lib/components/Field.svelte"
|
||||
import FieldInline from "@lib/components/FieldInline.svelte"
|
||||
@@ -22,8 +22,8 @@
|
||||
|
||||
const reset = () => {
|
||||
settings = {...$userSettingsValues}
|
||||
mutedPubkeys = getPubkeyTagValues(getListTags($userMutes))
|
||||
blossomServers = getTagValues("server", getListTags($userBlossomServers))
|
||||
mutedPubkeys = getPubkeyTagValues(getListTags($userMuteList))
|
||||
blossomServers = getTagValues("server", getListTags($userBlossomServerList))
|
||||
}
|
||||
|
||||
const onsubmit = preventDefault(async () => {
|
||||
@@ -43,8 +43,8 @@
|
||||
})
|
||||
|
||||
let settings = $state({...$userSettingsValues})
|
||||
let mutedPubkeys = $state(getPubkeyTagValues(getListTags($userMutes)))
|
||||
let blossomServers = $state(getTagValues("server", getListTags($userBlossomServers)))
|
||||
let mutedPubkeys = $state(getPubkeyTagValues(getListTags($userMuteList)))
|
||||
let blossomServers = $state(getTagValues("server", getListTags($userBlossomServerList)))
|
||||
</script>
|
||||
|
||||
<form class="content column gap-4" {onsubmit}>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script lang="ts">
|
||||
import {onMount} from "svelte"
|
||||
import {pubkey, relaySelections, inboxRelaySelections, derivePubkeyRelays} from "@welshman/app"
|
||||
import {pubkey, getRelayLists, getMessagingRelayLists, derivePubkeyRelays} from "@welshman/app"
|
||||
import {RelayMode} from "@welshman/util"
|
||||
import Icon from "@lib/components/Icon.svelte"
|
||||
import Button from "@lib/components/Button.svelte"
|
||||
@@ -9,7 +9,7 @@
|
||||
import RelayAdd from "@app/components/RelayAdd.svelte"
|
||||
import {pushModal} from "@app/util/modal"
|
||||
import {discoverRelays} from "@app/core/requests"
|
||||
import {setRelayPolicy, setInboxRelayPolicy} from "@app/core/commands"
|
||||
import {setRelayPolicy, setMessagingRelayPolicy} from "@app/core/commands"
|
||||
import Globus from "@assets/icons/globus.svg?dataurl"
|
||||
import Inbox from "@assets/icons/inbox.svg?dataurl"
|
||||
import Mailbox from "@assets/icons/mailbox.svg?dataurl"
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
const readRelayUrls = derivePubkeyRelays($pubkey!, RelayMode.Read)
|
||||
const writeRelayUrls = derivePubkeyRelays($pubkey!, RelayMode.Write)
|
||||
const inboxRelayUrls = derivePubkeyRelays($pubkey!, RelayMode.Inbox)
|
||||
const messagingRelayUrls = derivePubkeyRelays($pubkey!, RelayMode.Messaging)
|
||||
|
||||
const addReadRelay = () =>
|
||||
pushModal(RelayAdd, {
|
||||
@@ -32,20 +32,20 @@
|
||||
addRelay: (url: string) => setRelayPolicy(url, $readRelayUrls.includes(url), true),
|
||||
})
|
||||
|
||||
const addInboxRelay = () =>
|
||||
const addMessagingRelay = () =>
|
||||
pushModal(RelayAdd, {
|
||||
relays: inboxRelayUrls,
|
||||
addRelay: (url: string) => setInboxRelayPolicy(url, true),
|
||||
relays: messagingRelayUrls,
|
||||
addRelay: (url: string) => setMessagingRelayPolicy(url, true),
|
||||
})
|
||||
|
||||
const removeReadRelay = (url: string) => setRelayPolicy(url, false, $writeRelayUrls.includes(url))
|
||||
|
||||
const removeWriteRelay = (url: string) => setRelayPolicy(url, $readRelayUrls.includes(url), false)
|
||||
|
||||
const removeInboxRelay = (url: string) => setInboxRelayPolicy(url, false)
|
||||
const removeMessagingRelay = (url: string) => setMessagingRelayPolicy(url, false)
|
||||
|
||||
onMount(() => {
|
||||
discoverRelays([...$relaySelections, ...$inboxRelaySelections])
|
||||
discoverRelays([...getRelayLists(), ...getMessagingRelayLists()])
|
||||
})
|
||||
</script>
|
||||
|
||||
@@ -130,19 +130,19 @@
|
||||
</p>
|
||||
{/snippet}
|
||||
<div class="column gap-2">
|
||||
{#each $inboxRelayUrls.sort() as url (url)}
|
||||
{#each $messagingRelayUrls.sort() as url (url)}
|
||||
<RelayItem {url}>
|
||||
<Button
|
||||
class="tooltip flex items-center"
|
||||
data-tip="Stop using this relay"
|
||||
onclick={() => removeInboxRelay(url)}>
|
||||
onclick={() => removeMessagingRelay(url)}>
|
||||
<Icon icon={CloseCircle} />
|
||||
</Button>
|
||||
</RelayItem>
|
||||
{:else}
|
||||
<p class="text-center text-sm">No relays found</p>
|
||||
{/each}
|
||||
<Button class="btn btn-primary mt-2" onclick={addInboxRelay}>
|
||||
<Button class="btn btn-primary mt-2" onclick={addMessagingRelay}>
|
||||
<Icon icon={AddCircle} />
|
||||
Add Relay
|
||||
</Button>
|
||||
|
||||
Reference in New Issue
Block a user