From e44ac163964ae2c29ef5d98439685aba9770e3aa Mon Sep 17 00:00:00 2001
From: Lim Chee Aun <cheeaun@gmail.com>
Date: Sat, 6 Jan 2024 19:15:48 +0800
Subject: [PATCH] Fix flash of unscrolled position

Due to statuses being memo-ed, need to speed up the scroll position setup
---
 src/pages/status.jsx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/pages/status.jsx b/src/pages/status.jsx
index aa425abb..ad8b4f0e 100644
--- a/src/pages/status.jsx
+++ b/src/pages/status.jsx
@@ -438,7 +438,7 @@ function StatusThread({ id, closeLink = '/', instance: propInstance }) {
   };
 
   useEffect(initContext, [id, masto]);
-  useEffect(() => {
+  useLayoutEffect(() => {
     if (!statuses.length) return;
     console.debug('STATUSES', statuses);
     const scrollPosition = scrollPositions[id];