mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
fix(post): avoid duplicate history entries on OP permalinks
This commit is contained in:
@@ -42,7 +42,7 @@ import useQuotedByMap from '../../hooks/use-quoted-by-map';
|
||||
import useProgressiveRender from '../../hooks/use-progressive-render';
|
||||
import { BOARD_REPLIES_PREVIEW_FETCH_SIZE, BOARD_REPLIES_PREVIEW_VISIBLE_COUNT, REPLIES_PER_PAGE } from '../../lib/constants';
|
||||
import { filterRepliesForDisplay, getPreviewDisplayReplies } from '../../lib/utils/replies-preview-utils';
|
||||
import { scrollThreadContainerToTop } from '../../lib/utils/thread-scroll-utils';
|
||||
import { openThreadAtTop } from '../../lib/utils/thread-scroll-utils';
|
||||
|
||||
const { addChallenge } = useChallengesStore.getState();
|
||||
|
||||
@@ -256,10 +256,11 @@ const PostInfoAndMedia = ({ post, postReplyCount = 0, roles, threadNumber }: Pos
|
||||
|
||||
if (isInPostPageView && !isReply) {
|
||||
e.preventDefault();
|
||||
navigate(threadRoute);
|
||||
scrollThreadContainerToTop(cid);
|
||||
window.requestAnimationFrame(() => {
|
||||
scrollThreadContainerToTop(cid);
|
||||
openThreadAtTop({
|
||||
cid,
|
||||
currentPathname: location.pathname,
|
||||
navigate,
|
||||
threadRoute,
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user