diff --git a/src/components/link.jsx b/src/components/link.jsx
index 3dee227d..39698d26 100644
--- a/src/components/link.jsx
+++ b/src/components/link.jsx
@@ -25,6 +25,7 @@ const Link = (props) => {
class={`${props.class || ''} ${isActive ? 'is-active' : ''}`}
onClick={() => {
if (routerLocation) states.prevLocation = routerLocation;
+ props.onClick?.();
}}
/>
);
diff --git a/src/pages/status.jsx b/src/pages/status.jsx
index 66980424..a98b1afc 100644
--- a/src/pages/status.jsx
+++ b/src/pages/status.jsx
@@ -24,6 +24,10 @@ import useTitle from '../utils/useTitle';
const LIMIT = 40;
+function resetScrollPosition(id) {
+ delete states.scrollPositions[id];
+}
+
function StatusPage() {
const { id } = useParams();
const location = useLocation();
@@ -190,6 +194,7 @@ function StatusPage() {
console.debug('scrollPosition', scrollPosition);
if (!!scrollPosition) {
console.debug('Case 1', {
+ id,
scrollPosition,
});
scrollableRef.current.scrollTop = scrollPosition;
@@ -420,7 +425,13 @@ function StatusPage() {
) : (
-
+ {
+ resetScrollPosition(statusID);
+ }}
+ >
{},
-}) {
+function SubComments({ hasManyStatuses, replies }) {
// If less than or 2 replies and total number of characters of content from replies is less than 500
let isBrief = false;
if (replies.length <= 2) {
@@ -551,7 +558,9 @@ function SubComments({
{
+ resetScrollPosition(r.id);
+ }}
>
{r.repliesCount > 0 && (