Filter out non-global chat from global chat

This commit is contained in:
Jon Staab
2025-07-31 13:25:40 -07:00
parent 0cc0598287
commit 831ec05012
6 changed files with 12 additions and 7 deletions

View File

@@ -6,6 +6,7 @@
* Add signer status to profile page * Add signer status to profile page
* Re-work bunker login flow * Re-work bunker login flow
* Only protect events if relay authenticates * Only protect events if relay authenticates
* Filter out non-global chats from global chat
# 1.2.2 # 1.2.2

View File

@@ -281,7 +281,7 @@
}) })
onDestroy(() => { onDestroy(() => {
cleanup() cleanup?.()
// Sveltekit calls onDestroy at the beginning of the page load for some reason // Sveltekit calls onDestroy at the beginning of the page load for some reason
setTimeout(() => { setTimeout(() => {

View File

@@ -108,7 +108,7 @@
return () => { return () => {
setChecked($page.url.pathname) setChecked($page.url.pathname)
cleanup() cleanup?.()
} }
}) })
</script> </script>

View File

@@ -1,11 +1,11 @@
<script lang="ts"> <script lang="ts">
import {readable} from "svelte/store"
import {onMount, onDestroy} from "svelte" import {onMount, onDestroy} from "svelte"
import {page} from "$app/stores" import {page} from "$app/stores"
import type {Readable} from "svelte/store" import type {Readable} from "svelte/store"
import {readable} from "svelte/store"
import {now, formatTimestampAsDate} from "@welshman/lib" import {now, formatTimestampAsDate} from "@welshman/lib"
import type {TrustedEvent, EventContent} from "@welshman/util" import type {TrustedEvent, EventContent} from "@welshman/util"
import {makeEvent, MESSAGE, DELETE} from "@welshman/util" import {makeEvent, getTag, MESSAGE, DELETE} from "@welshman/util"
import {pubkey, publishThunk} from "@welshman/app" import {pubkey, publishThunk} from "@welshman/app"
import {slide, fade, fly} from "@lib/transition" import {slide, fade, fly} from "@lib/transition"
import Icon from "@lib/components/Icon.svelte" import Icon from "@lib/components/Icon.svelte"
@@ -123,6 +123,10 @@
continue continue
} }
if (getTag("h", event.tags)) {
continue
}
const date = formatTimestampAsDate(event.created_at) const date = formatTimestampAsDate(event.created_at)
if ( if (
@@ -194,7 +198,7 @@
}) })
onDestroy(() => { onDestroy(() => {
cleanup() cleanup?.()
// Sveltekit calls onDestroy at the beginning of the page load for some reason // Sveltekit calls onDestroy at the beginning of the page load for some reason
setTimeout(() => { setTimeout(() => {

View File

@@ -68,7 +68,7 @@
}) })
return () => { return () => {
cleanup() cleanup?.()
setChecked($page.url.pathname) setChecked($page.url.pathname)
} }
}) })

View File

@@ -69,7 +69,7 @@
}) })
return () => { return () => {
cleanup() cleanup?.()
setChecked($page.url.pathname) setChecked($page.url.pathname)
} }
}) })