this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

More reliable back button

Uses new Navigation API

+14 -1
+14 -1
src/pages/status.jsx
··· 66 66 const STATUSES_SELECTOR = 67 67 '.status-link:not(details:not([open]) > summary ~ *, details:not([open]) > summary ~ * *), .status-focus:not(details:not([open]) > summary ~ *, details:not([open]) > summary ~ * *)'; 68 68 69 + const STATUS_URL_REGEX = /\/s\//i; 70 + 69 71 function StatusPage(params) { 70 72 const { id } = params; 71 73 const { masto, instance } = api({ instance: params.instance }); ··· 872 874 ], 873 875 ); 874 876 877 + const prevLocationIsStatusPage = useMemo(() => { 878 + // Navigation API 879 + if (navigation?.entries) { 880 + const prevEntry = navigation.entries()[navigation.currentEntry.index - 1]; 881 + if (prevEntry?.url) { 882 + return STATUS_URL_REGEX.test(prevEntry.url); 883 + } 884 + } 885 + return STATUS_URL_REGEX.test(states.prevLocation?.pathname); 886 + }, [sKey]); 887 + 875 888 return ( 876 889 <div 877 890 tabIndex="-1" ··· 908 921 </div> */} 909 922 <div class="header-grid header-grid-2"> 910 923 <h1> 911 - {!!/\/s\//i.test(snapStates.prevLocation?.pathname) && ( 924 + {prevLocationIsStatusPage && ( 912 925 <button 913 926 type="button" 914 927 class="plain deck-back"