Commit 24258d46 authored by tom's avatar tom

disable shallow navigation for blocks

parent c1829e8d
...@@ -52,8 +52,10 @@ const BlockDetails = () => { ...@@ -52,8 +52,10 @@ const BlockDetails = () => {
const handlePrevNextClick = React.useCallback((direction: 'prev' | 'next') => { const handlePrevNextClick = React.useCallback((direction: 'prev' | 'next') => {
const increment = direction === 'next' ? +1 : -1; const increment = direction === 'next' ? +1 : -1;
const url = link('block_index', { id: String(Number(router.query.id) + increment) }); const nextId = String(Number(router.query.id) + increment);
router.push(url, undefined, { shallow: true });
const url = link('block_index', { id: nextId });
router.push(url, undefined);
}, [ link, router ]); }, [ link, router ]);
if (isLoading) { if (isLoading) {
......
...@@ -21,9 +21,13 @@ export interface Props { ...@@ -21,9 +21,13 @@ export interface Props {
const BlockPageContent = ({ tab }: Props) => { const BlockPageContent = ({ tab }: Props) => {
const router = useRouter(); const router = useRouter();
if (!router.query.id) {
return null;
}
return ( return (
<Page> <Page>
<PageTitle text={ `Block #${ router.query.id || '' }` }/> <PageTitle text={ `Block #${ router.query.id }` }/>
<RoutedTabs <RoutedTabs
tabs={ TABS } tabs={ TABS }
defaultActiveTab={ tab } defaultActiveTab={ tab }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment