From 238604852931fffac51eac7ba7f70f7d14db6b78 Mon Sep 17 00:00:00 2001 From: Justin Cano Date: Thu, 16 May 2024 09:56:07 -0700 Subject: [PATCH] Debug log route when opening post --- src/components/GridItem.astro | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/GridItem.astro b/src/components/GridItem.astro index c5c8f44..5cb94a6 100644 --- a/src/components/GridItem.astro +++ b/src/components/GridItem.astro @@ -36,10 +36,15 @@ const {class: className = '', postId, thumbnail} = Astro.props; const inner = this.querySelector('img'); const postId = this.dataset.post; if (inner && postId) { - inner.addEventListener('click', () => navigate(postId)); + inner.addEventListener('click', () => open(postId)); } } } + function open(route: string) { + console.debug(route); + navigate(route); + } + customElements.define('grid-item-container', GridItemContainer);