fix(quotes): scope post-number lookup by subplebbit, OP quote always navigates to thread

- numberToCid scoped by subplebbit address to fix wrong preview in /all/
- OP quote click navigates to thread page instead of highlighting card
This commit is contained in:
plebeius
2026-02-26 15:08:33 +08:00
parent c8824eb5d5
commit 216073aee3
9 changed files with 55 additions and 29 deletions
+2 -2
View File
@@ -56,8 +56,8 @@ const usePublishReply = ({ cid, subplebbitAddress, postCid }: { cid: string; sub
const resetPublishReplyOptions = useCallback(() => resetPublishReplyStore(parentCid), [parentCid, resetPublishReplyStore]);
const numberToCid = usePostNumberStore((state) => state.numberToCid);
const quotedCids = useMemo(() => getQuotedCidsFromContent(content, numberToCid), [content, numberToCid]);
const scopedNumberToCid = usePostNumberStore((state) => (subplebbitAddress ? state.numberToCid[subplebbitAddress] : undefined));
const quotedCids = useMemo(() => getQuotedCidsFromContent(content, scopedNumberToCid), [content, scopedNumberToCid]);
const publishOptions = useMemo(() => mergeQuotedCids(publishCommentOptions, quotedCids), [publishCommentOptions, quotedCids]);