Switch wording to messaging from inbox
This commit is contained in:
@@ -25,9 +25,9 @@
|
||||
import SpaceCheck from "@app/components/SpaceCheck.svelte"
|
||||
import {
|
||||
bootstrapPubkeys,
|
||||
loadGroupSelections,
|
||||
getSpaceUrlsFromGroupSelections,
|
||||
groupSelectionsPubkeysByUrl,
|
||||
loadGroupList,
|
||||
getSpaceUrlsFromGroupList,
|
||||
groupListsPubkeysByUrl,
|
||||
parseInviteLink,
|
||||
} from "@app/core/state"
|
||||
import {pushModal} from "@app/util/modal"
|
||||
@@ -50,8 +50,8 @@
|
||||
relays: Router.get().Index().getUrls(),
|
||||
}),
|
||||
...$bootstrapPubkeys.map(async pubkey => {
|
||||
const list = await loadGroupSelections(pubkey)
|
||||
const urls = getSpaceUrlsFromGroupSelections(list)
|
||||
const list = await loadGroupList(pubkey)
|
||||
const urls = getSpaceUrlsFromGroupList(list)
|
||||
|
||||
await Promise.all(urls.map(url => loadRelay(url)))
|
||||
}),
|
||||
@@ -59,13 +59,13 @@
|
||||
|
||||
const relaySearch = $derived(
|
||||
createSearch(
|
||||
$relays.filter(r => $groupSelectionsPubkeysByUrl.has(r.url) && r.url !== inviteData?.url),
|
||||
$relays.filter(r => $groupListsPubkeysByUrl.has(r.url) && r.url !== inviteData?.url),
|
||||
{
|
||||
getValue: (relay: RelayProfile) => relay.url,
|
||||
sortFn: ({score, item}) => {
|
||||
if (score && score > 0.1) return -score!
|
||||
|
||||
const wotScore = $groupSelectionsPubkeysByUrl.get(item.url)!.size
|
||||
const wotScore = $groupListsPubkeysByUrl.get(item.url)!.size
|
||||
|
||||
return score ? dec(score) * wotScore : -wotScore
|
||||
},
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
import PageContent from "@lib/components/PageContent.svelte"
|
||||
import MenuSpacesItem from "@app/components/MenuSpacesItem.svelte"
|
||||
import SpaceAdd from "@app/components/SpaceAdd.svelte"
|
||||
import {userSpaceUrls, loadUserGroupSelections, PLATFORM_RELAYS} from "@app/core/state"
|
||||
import {userSpaceUrls, loadUserGroupList, PLATFORM_RELAYS} from "@app/core/state"
|
||||
import {pushModal} from "@app/util/modal"
|
||||
|
||||
const addSpace = () => pushModal(SpaceAdd)
|
||||
@@ -37,7 +37,7 @@
|
||||
{#each PLATFORM_RELAYS as url (url)}
|
||||
<MenuSpacesItem {url} />
|
||||
{:else}
|
||||
{#await loadUserGroupSelections()}
|
||||
{#await loadUserGroupList()}
|
||||
<div class="flex justify-center items-center py-20">
|
||||
<span class="loading loading-spinner mr-3"></span>
|
||||
Loading your spaces...
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
import {COMMENT, getTagValue} from "@welshman/util"
|
||||
import {request} from "@welshman/net"
|
||||
import {repository} from "@welshman/app"
|
||||
import {deriveEvents} from "@welshman/store"
|
||||
import {deriveEventsById, deriveEventsDesc} from "@welshman/store"
|
||||
import AltArrowLeft from "@assets/icons/alt-arrow-left.svg?dataurl"
|
||||
import SortVertical from "@assets/icons/sort-vertical.svg?dataurl"
|
||||
import Reply from "@assets/icons/reply-2.svg?dataurl"
|
||||
@@ -30,7 +30,7 @@
|
||||
const url = decodeRelay(relay)
|
||||
const event = deriveEvent(id)
|
||||
const filters = [{kinds: [COMMENT], "#E": [id]}]
|
||||
const replies = deriveEvents(repository, {filters})
|
||||
const replies = deriveEventsDesc(deriveEventsById({filters, repository}))
|
||||
|
||||
const back = () => history.back()
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
import {COMMENT, getTagValue} from "@welshman/util"
|
||||
import {repository} from "@welshman/app"
|
||||
import {request} from "@welshman/net"
|
||||
import {deriveEvents} from "@welshman/store"
|
||||
import {deriveEventsById, deriveEventsDesc} from "@welshman/store"
|
||||
import AltArrowLeft from "@assets/icons/alt-arrow-left.svg?dataurl"
|
||||
import SortVertical from "@assets/icons/sort-vertical.svg?dataurl"
|
||||
import Reply from "@assets/icons/reply-2.svg?dataurl"
|
||||
@@ -29,7 +29,7 @@
|
||||
const url = decodeRelay(relay)
|
||||
const event = deriveEvent(id)
|
||||
const filters = [{kinds: [COMMENT], "#E": [id]}]
|
||||
const replies = deriveEvents(repository, {filters})
|
||||
const replies = deriveEventsDesc(deriveEventsById({repository, filters}))
|
||||
const summary = getTagValue("summary", $event.tags)
|
||||
|
||||
const back = () => history.back()
|
||||
@@ -98,7 +98,7 @@
|
||||
</Button>
|
||||
</div>
|
||||
{/if}
|
||||
{#each sortBy(e => e.created_at, $replies).slice(0, showAll ? undefined : 4) as reply (reply.id)}
|
||||
{#each $replies.slice(0, showAll ? undefined : 4) as reply (reply.id)}
|
||||
<NoteCard event={reply} {url} class="card2 bg-alt z-feature w-full">
|
||||
<div class="col-3 ml-12">
|
||||
<Content showEntire event={reply} {url} />
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
import {COMMENT, getTagValue} from "@welshman/util"
|
||||
import {repository} from "@welshman/app"
|
||||
import {request} from "@welshman/net"
|
||||
import {deriveEvents} from "@welshman/store"
|
||||
import {deriveEventsById, deriveEventsDesc} from "@welshman/store"
|
||||
import AltArrowLeft from "@assets/icons/alt-arrow-left.svg?dataurl"
|
||||
import SortVertical from "@assets/icons/sort-vertical.svg?dataurl"
|
||||
import Reply from "@assets/icons/reply-2.svg?dataurl"
|
||||
@@ -28,7 +28,7 @@
|
||||
const url = decodeRelay(relay)
|
||||
const event = deriveEvent(id)
|
||||
const filters = [{kinds: [COMMENT], "#E": [id]}]
|
||||
const replies = deriveEvents(repository, {filters})
|
||||
const replies = deriveEventsDesc(deriveEventsById({filters, repository}))
|
||||
|
||||
const back = () => history.back()
|
||||
|
||||
@@ -95,7 +95,7 @@
|
||||
</Button>
|
||||
</div>
|
||||
{/if}
|
||||
{#each sortBy(e => e.created_at, $replies).slice(0, showAll ? undefined : 4) as reply (reply.id)}
|
||||
{#each $replies.slice(0, showAll ? undefined : 4) as reply (reply.id)}
|
||||
<NoteCard event={reply} {url} class="card2 bg-alt z-feature w-full">
|
||||
<div class="col-3 ml-12">
|
||||
<Content showEntire event={reply} {url} />
|
||||
|
||||
Reference in New Issue
Block a user