diff --git a/src/views/ArticleDetail/index.tsx b/src/views/ArticleDetail/index.tsx index 0ba07e02c4..7909cdc692 100644 --- a/src/views/ArticleDetail/index.tsx +++ b/src/views/ArticleDetail/index.tsx @@ -380,7 +380,11 @@ const ArticleDetail = ({ /** * fetch public data */ - const isQueryByHash = !!(mediaHash && isMediaHashPossiblyValid(mediaHash)) + const isQueryByHash = !!( + mediaHash && + isMediaHashPossiblyValid(mediaHash) && + !articleId + ) // backward compatible with: // - `/:username:/:articleId:-:slug:-:mediaHash` @@ -607,7 +611,12 @@ const ArticleDetailOuter = () => { const articleId = (router.query.mediaHash as string)?.match(/^(\d+)/)?.[1] || '' - const isQueryByHash = !!(mediaHash && isMediaHashPossiblyValid(mediaHash)) + const isQueryByHash = !!( + mediaHash && + isMediaHashPossiblyValid(mediaHash) && + !articleId + ) + const resultByHash = usePublicQuery( ARTICLE_AVAILABLE_TRANSLATIONS, { variables: { mediaHash }, skip: !isQueryByHash }