Make content components reactive
This commit is contained in:
parent
a254ec10f1
commit
c139722261
2 changed files with 9 additions and 5 deletions
|
|
@ -59,7 +59,7 @@
|
|||
url,
|
||||
}: Props = $props()
|
||||
|
||||
const fullContent = parse(event)
|
||||
const fullContent = $derived(parse(event))
|
||||
|
||||
const expand = () => {
|
||||
showEntire = true
|
||||
|
|
@ -98,12 +98,16 @@
|
|||
|
||||
const isQuote = (p: Parsed) => isEvent(p) || isAddress(p)
|
||||
|
||||
let warningDismissed = $state(false)
|
||||
|
||||
const ignoreWarning = () => {
|
||||
warning = null
|
||||
warningDismissed = true
|
||||
}
|
||||
|
||||
let warning = $state(
|
||||
$userSettingsValues.hide_sensitive && event.tags.find(nthEq(0, "content-warning"))?.[1],
|
||||
const warning = $derived(
|
||||
warningDismissed
|
||||
? undefined
|
||||
: $userSettingsValues.hide_sensitive && event.tags.find(nthEq(0, "content-warning"))?.[1],
|
||||
)
|
||||
|
||||
const dropWhile = <T,>(f: (x: T) => boolean, xs: Iterable<T>) => {
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@
|
|||
|
||||
const {event, trimParent = false, singleLine = false, url}: Props = $props()
|
||||
|
||||
const fullContent = parse(event)
|
||||
const fullContent = $derived(parse(event))
|
||||
|
||||
const isBoundary = (i: number) => {
|
||||
const parsed = fullContent[i]
|
||||
|
|
|
|||
Loading…
Reference in a new issue