diff --git a/src/app/components/ContentLinkBlock.svelte b/src/app/components/ContentLinkBlock.svelte index abe1105d..ec981015 100644 --- a/src/app/components/ContentLinkBlock.svelte +++ b/src/app/components/ContentLinkBlock.svelte @@ -1,12 +1,12 @@ -{#if url.match(/\.(jpe?g|png|gif|webp)$/)} +{#if url.match(/\.(jpe?g|png|gif|webp)$/) || IMAGE_CONTENT_TYPES.includes(fileType)} { } } - addEvents(repository.query([{kinds: [DIRECT_MESSAGE, PROFILE]}])) + addEvents(repository.query([{kinds: [...DM_KINDS, PROFILE]}])) const unsubscribers = [ on(repository, "update", ({added}: RepositoryUpdate) => addEvents(added)), diff --git a/src/app/util/routes.ts b/src/app/util/routes.ts index 51f9268d..9726625c 100644 --- a/src/app/util/routes.ts +++ b/src/app/util/routes.ts @@ -10,8 +10,6 @@ import {scrollToEvent} from "@lib/html" import {identity} from "@welshman/lib" import { getTagValue, - DIRECT_MESSAGE, - DIRECT_MESSAGE_FILE, MESSAGE, THREAD, CLASSIFIED, @@ -26,6 +24,7 @@ import { encodeRelay, userSpaceUrls, hasNip29, + DM_KINDS, ROOM, } from "@app/core/state" import {lastPageBySpaceUrl} from "@app/util/history" @@ -108,7 +107,7 @@ export const goToEvent = async (event: TrustedEvent, options: Record { - if (event.kind === DIRECT_MESSAGE || event.kind === DIRECT_MESSAGE_FILE) { + if (DM_KINDS.includes(event.kind)) { return makeChatPath([event.pubkey, ...getPubkeyTagValues(event.tags)]) }