Fix more stuff, particularly event handlers

This commit is contained in:
Jon Staab
2025-02-03 17:21:46 -08:00
parent 8d3433b167
commit 24045a7e2a
150 changed files with 424 additions and 392 deletions
@@ -2,7 +2,7 @@
import {onMount} from "svelte"
import {derived} from "svelte/store"
import {page} from "$app/stores"
import {sortBy, min, nthEq, sleep} from "@welshman/lib"
import {sortBy, min, nthEq} from "@welshman/lib"
import {THREAD, COMMENT, getListTags, getPubkeyTagValues} from "@welshman/util"
import {throttled} from "@welshman/store"
import {feedFromFilters, makeIntersectionFeed, makeRelayFeed} from "@welshman/feeds"
@@ -96,7 +96,7 @@
{/snippet}
{#snippet action()}
<div class="row-2">
<Button class="btn btn-primary btn-sm" on:click={createThread}>
<Button class="btn btn-primary btn-sm" onclick={createThread}>
<Icon icon="notes-minimalistic" />
Create a Thread
</Button>
@@ -1,8 +1,8 @@
<script lang="ts">
import {onMount} from "svelte"
import {page} from "$app/stores"
import {sortBy, nthEq, sleep} from "@welshman/lib"
import {COMMENT} from "@welshman/util"
import {sortBy, sleep} from "@welshman/lib"
import {COMMENT, getTagValue} from "@welshman/util"
import {repository, subscribe} from "@welshman/app"
import {deriveEvents} from "@welshman/store"
import Icon from "@lib/components/Icon.svelte"
@@ -40,8 +40,6 @@
let showAll = $state(false)
let showReply = $state(false)
let title = $derived($event?.tags.find(nthEq(0, "title"))?.[1] || "")
onMount(() => {
const sub = subscribe({relays: [url], filters})
@@ -57,7 +55,7 @@
{#if $event}
{#if !showReply}
<div class="flex justify-end px-2 pb-2">
<Button class="btn btn-primary" on:click={openReply}>
<Button class="btn btn-primary" onclick={openReply}>
<Icon icon="reply" />
Reply to thread
</Button>
@@ -73,7 +71,7 @@
{/each}
{#if !showAll && $replies.length > 4}
<div class="flex justify-center">
<Button class="btn btn-link" on:click={expand}>
<Button class="btn btn-link" onclick={expand}>
<Icon icon="sort-vertical" />
Show all {$replies.length} replies
</Button>
@@ -95,14 +93,14 @@
<PageBar class="mx-0">
{#snippet icon()}
<div>
<Button class="btn btn-neutral btn-sm" on:click={back}>
<Button class="btn btn-neutral btn-sm" onclick={back}>
<Icon icon="alt-arrow-left" />
Go back
</Button>
</div>
{/snippet}
{#snippet title()}
<h1 class="text-xl">{title}</h1>
<h1 class="text-xl">{getTagValue("title", $event?.tags || []) || ""}</h1>
{/snippet}
{#snippet action()}
<div>