Use address for page param for replaceable events
This commit is contained in:
+10
-8
@@ -24,10 +24,10 @@
|
||||
import {deriveEvent, decodeRelay} from "@app/core/state"
|
||||
import {setChecked} from "@app/util/notifications"
|
||||
|
||||
const {relay, id} = $page.params as MakeNonOptional<typeof $page.params>
|
||||
const {relay, address} = $page.params as MakeNonOptional<typeof $page.params>
|
||||
const url = decodeRelay(relay)
|
||||
const event = deriveEvent(id, [url])
|
||||
const filters = [{kinds: [COMMENT], "#E": [id]}]
|
||||
const event = deriveEvent(address, [url])
|
||||
const filters = [{kinds: [COMMENT], "#A": [address]}]
|
||||
const replies = deriveEventsAsc(deriveEventsById({filters, repository}))
|
||||
|
||||
const back = () => history.back()
|
||||
@@ -115,10 +115,12 @@
|
||||
</div>
|
||||
{/if}
|
||||
{:else}
|
||||
{#await sleep(5000)}
|
||||
<Spinner loading>Loading listing...</Spinner>
|
||||
{:then}
|
||||
<p>Failed to load classified listing.</p>
|
||||
{/await}
|
||||
<div class="py-20 m-auto">
|
||||
{#await sleep(5000)}
|
||||
<Spinner loading>Loading listing...</Spinner>
|
||||
{:then}
|
||||
<p>Failed to load classified listing.</p>
|
||||
{/await}
|
||||
</div>
|
||||
{/if}
|
||||
</PageContent>
|
||||
@@ -140,7 +140,7 @@
|
||||
<Icon icon={AltArrowRight} />
|
||||
</Link>
|
||||
{:else if event.kind === CLASSIFIED}
|
||||
<Link href={makeClassifiedPath(url, event.id)} class="btn btn-primary btn-sm">
|
||||
<Link href={makeClassifiedPath(url, getAddress(event))} class="btn btn-primary btn-sm">
|
||||
View Listing
|
||||
<Icon icon={AltArrowRight} />
|
||||
</Link>
|
||||
@@ -150,7 +150,7 @@
|
||||
<Icon icon={AltArrowRight} />
|
||||
</Link>
|
||||
{:else if event.kind === EVENT_TIME}
|
||||
<Link href={makeCalendarPath(url, event.id)} class="btn btn-primary btn-sm">
|
||||
<Link href={makeCalendarPath(url, getAddress(event))} class="btn btn-primary btn-sm">
|
||||
View Event
|
||||
<Icon icon={AltArrowRight} />
|
||||
</Link>
|
||||
|
||||
Reference in New Issue
Block a user