From 623bee46327d5891bc893074490a4298cbeaa9ec Mon Sep 17 00:00:00 2001 From: Gigi Date: Thu, 23 Oct 2025 09:44:20 +0200 Subject: [PATCH] fix: timestamp in highlight cards now opens content in app instead of external search --- src/components/HighlightItem.tsx | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/src/components/HighlightItem.tsx b/src/components/HighlightItem.tsx index d6617698..d9d8ed80 100644 --- a/src/components/HighlightItem.tsx +++ b/src/components/HighlightItem.tsx @@ -433,7 +433,31 @@ export const HighlightItem: React.FC = ({ title={new Date(highlight.created_at * 1000).toLocaleString()} onClick={(e) => { e.stopPropagation() - window.location.href = highlightLinks.native + // Navigate within app using same logic as handleItemClick + if (highlight.eventReference) { + const parts = highlight.eventReference.split(':') + if (parts.length === 3 && parts[0] === '30023') { + const [kind, pubkey, identifier] = parts + const naddr = nip19.naddrEncode({ + kind: 30023, + pubkey, + identifier + }) + navigate(`/a/${naddr}`, { + state: { + highlightId: highlight.id, + openHighlights: true + } + }) + } + } else if (highlight.urlReference) { + navigate(`/r/${encodeURIComponent(highlight.urlReference)}`, { + state: { + highlightId: highlight.id, + openHighlights: true + } + }) + } }} > {formatDateCompact(highlight.created_at)}