fix retained scroll position while navigating

This commit is contained in:
Tom
2023-05-10 22:20:59 +02:00
parent 0433daf318
commit 0e77779f1e
6 changed files with 24 additions and 19 deletions
@@ -214,7 +214,8 @@ const SubscriptionsCatalog = () => {
const commentMediaInfo = getCommentMediaInfo(thread);
const fallbackImgUrl = "assets/filedeleted-res.gif";
return (
<Link style={{all: "unset", cursor: "pointer"}} key={`link-${index}`} to={`/p/${selectedAddress}/c/${thread.cid}`} onClick={() => setSelectedThread(thread.cid)}>
<Link style={{all: "unset", cursor: "pointer"}} key={`link-${index}`} to={`/p/${selectedAddress}/c/${thread.cid}`}
onClick={() => {setSelectedThread(thread.cid); window.scrollTo(0, 0);}}>
<div key={`thread-${index}`} className="thread">
{commentMediaInfo?.url ? (
<Fragment key="f-catalog">