mirror of
https://github.com/cheeaun/phanpy.git
synced 2025-03-14 12:18:30 +03:00
Further make use of Navigation API
history.length is seriously not reliable
This commit is contained in:
parent
616b9fcf02
commit
3361ffc366
1 changed files with 4 additions and 1 deletions
|
@ -177,7 +177,10 @@ function StatusThread({ id, closeLink = '/', instance: propInstance }) {
|
|||
const mediaParam = searchParams.get('media');
|
||||
const mediaStatusID = searchParams.get('mediaStatusID');
|
||||
const showMedia = parseInt(mediaParam, 10) > 0;
|
||||
const firstLoad = useRef(!states.prevLocation && history.length === 1);
|
||||
const firstLoad = useRef(
|
||||
!states.prevLocation &&
|
||||
(history.length === 1 || navigation?.entries?.()?.length === 1),
|
||||
);
|
||||
const [viewMode, setViewMode] = useState(
|
||||
searchParams.get('view') || firstLoad.current ? 'full' : null,
|
||||
);
|
||||
|
|
Loading…
Add table
Reference in a new issue