mirror of
https://github.com/cheeaun/phanpy.git
synced 2024-11-28 20:28:52 +03:00
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.
This commit is contained in:
parent
0038c2225b
commit
1c87dd6e41
1 changed files with 1 additions and 1 deletions
|
@ -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,
|
||||
);
|
||||
|
|
Loading…
Reference in a new issue