Compare commits

...

4 Commits

Author SHA1 Message Date
Jon Staab fb32bf8ccc Fix group name/description 2024-06-24 15:27:39 -07:00
Jon Staab 95c08ba3b9 Fix default zap split 2024-06-24 15:11:35 -07:00
Jon Staab 5075bccd1a Fix white screen 2024-06-24 15:03:41 -07:00
Jon Staab 67fe524dd1 Fix some notifications 2024-06-24 14:57:45 -07:00
9 changed files with 29 additions and 10 deletions

View File

@ -1,5 +1,7 @@
# Changelog
# 0.4.9
# 0.4.8
- [x] Add support for kind 10050 relay lists

View File

@ -5,6 +5,8 @@
export let address
const meta = deriveGroupMeta(address)
$: display = displayGroupMeta($meta)
</script>
<span class={$$props.class}>{displayGroupMeta($meta)}</span>
<span class={$$props.class} class:text-neutral-400={display === '[no name]'}>{display}</span>

View File

@ -149,7 +149,7 @@
const startZap = () => {
const zapTags = tags.whereKey("zap")
const defaultSplit = ["zap", ...mention(note.pubkey).slice(1), "1"]
const defaultSplit = ["zap", ...mention(note.pubkey).slice(1, 3), "1"]
const splits = zapTags.exists() ? zapTags.unwrap() : [defaultSplit]
router

View File

@ -16,6 +16,7 @@
import NotificationReplies from "src/app/views/NotificationReplies.svelte"
import {router} from "src/app/util/router"
import {
pubkey,
session,
settings,
markAsSeen,
@ -146,7 +147,7 @@
<div class="h-px w-full bg-neutral-600" />
</div>
{/if}
{#if !notification.event}
{#if notification.event?.pubkey !== $pubkey}
<NotificationMention {notification} />
{:else if activeTab === allTabs[0]}
<NotificationReplies {notification} />

View File

@ -1,6 +1,7 @@
<script lang="ts">
import {onMount} from "svelte"
import {pluck, identity} from "ramda"
import {pluck, equals} from "ramda"
import {identity} from "@welshman/lib"
import {MUTES} from "@welshman/util"
import {appName} from "src/partials/state"
import {showInfo} from "src/partials/Toast.svelte"
@ -28,8 +29,13 @@
const searchWords = q => pluck("name", $searchTopics(q))
const submit = () => {
publishSettings(values)
updateSingleton(MUTES, () => mutedPubkeys.map(mention))
if (!equals($settings, values)) {
publishSettings(values)
}
if (!equals(mutedPubkeys, Array.from($userMutes))) {
updateSingleton(MUTES, () => mutedPubkeys.map(mention))
}
showInfo("Your preferences have been saved!")
}

View File

@ -31,8 +31,8 @@ export const readGroupMeta = (event: TrustedEvent) => {
moderators: event.tags.filter(nthEq(0, 'p')),
identifier: meta.d,
name: meta.name || "",
about: meta.about || "",
banner: meta.banner || "",
about: meta.about || meta.description || "",
image: meta.image || meta.picture || "",
listing_is_public: isSignedEvent(event),
} as PublishedGroupMeta

View File

@ -721,6 +721,13 @@ export const updateSingleton = async (kind: number, modifyTags: ModifyTags) => {
const template = await encryptable.reconcile(encrypt)
if (window.location.origin.includes('localhost')) {
if (kind === MUTES) {
alert("Publishing mutes")
console.trace(template)
}
}
await createAndPublish({...template, content, relays})
}

View File

@ -527,7 +527,7 @@ export const listenForMessages = (pubkeys: string[]) => {
forcePlatform: false,
relays: hints.Messages(pubkeys).getUrls(),
filters: [
addSinceToFilter({kinds: [WRAP], "#p": [pubkey.get()]}, seconds(7, "day")),
addSinceToFilter({kinds: [WRAP], "#p": [pubkey.get()]}, seconds(14, "day")),
addSinceToFilter({kinds: [4], authors: allPubkeys}),
addSinceToFilter({kinds: [4], "#p": allPubkeys}),
],

View File

@ -252,7 +252,7 @@ export const defaultSettings = {
}
export const settings = withGetter(
derived(session, $session => ({...defaultSettings, ...$session.settings})),
derived(session, $session => ({...defaultSettings, ...$session?.settings})),
)
export const getSetting = k => prop(k, settings.get())
@ -1022,6 +1022,7 @@ export const createNotificationGroups = ($notifications, kinds) => {
return e
}
const $pubkey = pubkey.get()
const groups = {}
// Group notifications by event
@ -1033,7 +1034,7 @@ export const createNotificationGroups = ($notifications, kinds) => {
const parentId = Tags.fromEvent(ix).whereKey("e").parent()?.value()
const event = parentId ? repository.getEvent(parentId) : null
if (reactionKinds.includes(ix.kind) && !event) {
if (reactionKinds.includes(ix.kind) && event?.pubkey !== $pubkey) {
continue
}