From 1c87dd6e41e8c6ba80bdbb22f548bb73065790d5 Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Thu, 26 Oct 2023 11:42:44 +0800 Subject: [PATCH] Check for reload cases too Prevent status page from going full width when reloading itself This checks tab's history length, so opening status page on a new tab means length = 1. BUT this will fail if someone copies the link and paste to another **existing** tab with existing pre-populated history. --- 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 7e2017f1..5c074126 100644 --- a/src/pages/status.jsx +++ b/src/pages/status.jsx @@ -168,7 +168,7 @@ function StatusThread({ id, closeLink = '/', instance: propInstance }) { const [searchParams, setSearchParams] = useSearchParams(); const mediaParam = searchParams.get('media'); const showMedia = parseInt(mediaParam, 10) > 0; - const firstLoad = useRef(!states.prevLocation); + const firstLoad = useRef(!states.prevLocation && history.length === 1); const [viewMode, setViewMode] = useState( searchParams.get('view') || firstLoad.current ? 'full' : null, );