From 03e5a5b0cc9cc60967c48629982b6691e5bec922 Mon Sep 17 00:00:00 2001 From: Ardis Lu Date: Thu, 4 Aug 2022 21:34:09 -0700 Subject: [PATCH] Make routing logic explicit --- script.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/script.js b/script.js index 4fdcee0..486683f 100644 --- a/script.js +++ b/script.js @@ -183,9 +183,11 @@ function route(href) { location.href = href; return; } - - history.pushState({}, '', url); - showPage(url.pathname); + // For all other routes, use client-side routing + else { + history.pushState({}, '', url); + showPage(url.pathname); + } } /* Set event handlers for client-side routing */ -- 2.47.3