diff --git a/src/components/post/post.tsx b/src/components/post/post.tsx index 84ea1755..0802dd02 100644 --- a/src/components/post/post.tsx +++ b/src/components/post/post.tsx @@ -152,13 +152,13 @@ const Post = ({ index, post = {} }: PostProps) => { const { subscribe, subscribed } = useSubscribe({ subplebbitAddress }); // show gray dotted border around last clicked post - const isLastClicked = localStorage.getItem('lastClickedPost') === cid; + const isLastClicked = sessionStorage.getItem('lastClickedPost') === cid; const handlePostClick = () => { if (cid) { - if (localStorage.getItem('lastClickedPost') === cid) { - localStorage.removeItem('lastClickedPost'); + if (sessionStorage.getItem('lastClickedPost') === cid) { + sessionStorage.removeItem('lastClickedPost'); } else { - localStorage.setItem('lastClickedPost', cid); + sessionStorage.setItem('lastClickedPost', cid); } } };