fix(quotes): keep same-thread board previews local

This commit is contained in:
Tommaso Casaburi
2026-04-16 15:33:12 +07:00
parent f6ce2ba018
commit e366dac25c
16 changed files with 293 additions and 64 deletions
@@ -15,6 +15,7 @@ import { Post } from '../../views/post';
import styles from './markdown.module.css';
interface ExternalNumberQuoteLinkProps {
isOP?: boolean;
reference: ExternalQuoteReference;
}
@@ -42,7 +43,7 @@ type PreviewPosition = {
top: number;
};
const ExternalNumberQuoteLink = ({ reference }: ExternalNumberQuoteLinkProps) => {
const ExternalNumberQuoteLink = ({ isOP = false, reference }: ExternalNumberQuoteLinkProps) => {
const { t } = useTranslation();
const account = useAccount();
const directories = useDirectories();
@@ -61,6 +62,7 @@ const ExternalNumberQuoteLink = ({ reference }: ExternalNumberQuoteLinkProps) =>
const latestStatusMessageRef = useRef('');
const boardLabel = getExternalQuoteBoardLabel(reference, directories);
const linkLabel = isOP ? `${reference.raw} (OP)` : reference.raw;
const updatePreviewPosition = (anchor: HTMLElement | null) => {
if (!anchor || isMobile) {
@@ -276,7 +278,7 @@ const ExternalNumberQuoteLink = ({ reference }: ExternalNumberQuoteLinkProps) =>
onMouseLeave={handleMouseLeave}
ref={anchorRef}
>
{reference.raw}
{linkLabel}
</a>
{!isMobile &&
isPreviewOpen &&