feat: improve mobile navigation with tap-to-reset and history filtering
This commit is contained in:
@@ -32,7 +32,7 @@ type MobileShellProps = {
|
||||
|
||||
export function MobileShell({ title, subtitle, children, activeTab, onBack, headerActions }: MobileShellProps) {
|
||||
const { events, activeEvent, hasMultipleEvents, hasEvents, selectEvent } = useEventContext();
|
||||
const { go } = useMobileNav(activeEvent?.slug);
|
||||
const { go } = useMobileNav(activeEvent?.slug, activeTab);
|
||||
const navigate = useNavigate();
|
||||
const location = useLocation();
|
||||
const { t, i18n } = useTranslation('mobile');
|
||||
@@ -86,7 +86,15 @@ export function MobileShell({ title, subtitle, children, activeTab, onBack, head
|
||||
|
||||
React.useEffect(() => {
|
||||
const path = `${location.pathname}${location.search}${location.hash}`;
|
||||
setTabHistory(activeTab, path);
|
||||
|
||||
// Blacklist transient paths from being saved in tab history
|
||||
const isBlacklisted =
|
||||
location.pathname.includes('/billing/shop') ||
|
||||
location.pathname.includes('/welcome');
|
||||
|
||||
if (!isBlacklisted) {
|
||||
setTabHistory(activeTab, path);
|
||||
}
|
||||
}, [activeTab, location.hash, location.pathname, location.search]);
|
||||
|
||||
const refreshQueuedActions = React.useCallback(() => {
|
||||
|
||||
Reference in New Issue
Block a user