From 51915241fcc0bfbb95801e4299296bbf41b46c12 Mon Sep 17 00:00:00 2001 From: SnowCait Date: Thu, 19 Oct 2023 16:38:38 +0900 Subject: [PATCH] Get from store --- web/src/routes/[slug=note]/+page.svelte | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/web/src/routes/[slug=note]/+page.svelte b/web/src/routes/[slug=note]/+page.svelte index 3b15c8029..153d88609 100644 --- a/web/src/routes/[slug=note]/+page.svelte +++ b/web/src/routes/[slug=note]/+page.svelte @@ -3,7 +3,7 @@ import { createRxOneshotReq, filterKind, uniq, type LazyFilter } from 'rx-nostr'; import { tap, merge } from 'rxjs'; import { rxNostr, referencesReqEmit } from '$lib/timelines/MainTimeline'; - import { cachedEvents, metadataStore } from '$lib/cache/Events'; + import { eventItemStore, metadataStore } from '$lib/cache/Events'; import type { PageData } from './$types'; import { author, readRelays } from '../../stores/Author'; import { pool } from '../../stores/Pool'; @@ -83,15 +83,13 @@ clear(); - const event = cachedEvents.get(eventId); + item = $eventItemStore.get(eventId); const filters: LazyFilter[] = [ { '#e': [eventId] } ]; - if (event !== undefined) { - item = new EventItem(event); - } else { + if (item === undefined) { filters.push({ ids: [eventId] });