From dc2b6a5ab108f9e378196035c5e9dd324422159c Mon Sep 17 00:00:00 2001 From: dufok Date: Wed, 25 Sep 2024 17:04:08 -0300 Subject: [PATCH] debug: with reset data if slug is changes in slug/tab articalpage --- src/routes/[slug]/[...tab].tsx | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/src/routes/[slug]/[...tab].tsx b/src/routes/[slug]/[...tab].tsx index b5918985..9ebe49e6 100644 --- a/src/routes/[slug]/[...tab].tsx +++ b/src/routes/[slug]/[...tab].tsx @@ -1,6 +1,6 @@ import { RouteDefinition, RouteSectionProps, createAsync, useLocation } from '@solidjs/router' import { HttpStatusCode } from '@solidjs/start' -import { ErrorBoundary, Show, Suspense, createEffect, on, onMount } from 'solid-js' +import { ErrorBoundary, Show, Suspense, onMount } from 'solid-js' import { FourOuFourView } from '~/components/Views/FourOuFour' import { Loading } from '~/components/_shared/Loading' import { gaIdentity } from '~/config' @@ -29,6 +29,9 @@ export const route: RouteDefinition = { console.debug('route.load called with params:', params) const article = await fetchShout(params.slug) console.debug('route.load fetched article:', article) + if (!article) { + console.warn('No article fetched for the given slug:', params.slug); + } return { article } } } @@ -96,22 +99,6 @@ export default function ArticlePage(props: RouteSectionProps) { } }) - createEffect( - on( - data, - (a?: Shout) => { - console.debug('createEffect triggered with data:', a) - if (!a?.id) return - window?.gtag?.('event', 'page_view', { - page_title: a.title, - page_location: window?.location.href || '', - page_path: loc.pathname - }) - }, - { defer: true } - ) - ) - return ( { console.error('Rendering 500 error page')