From ba56445f4dd1577055d7948f3a66149b4f255325 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr?= <8machy@seznam.cz> Date: Sat, 22 Jun 2024 13:37:17 +0200 Subject: [PATCH] Fix back button --- packages/signalizejs/package.json | 2 +- packages/signalizejs/src/modules/spa.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/signalizejs/package.json b/packages/signalizejs/package.json index 679c75c..df96d73 100755 --- a/packages/signalizejs/package.json +++ b/packages/signalizejs/package.json @@ -1,6 +1,6 @@ { "name": "signalizejs", - "version": "0.1.1", + "version": "0.1.3", "description": "A client-side JavaScript framework designed for swift web development with minimum JavaScript.", "keywords": [ "signalize", diff --git a/packages/signalizejs/src/modules/spa.js b/packages/signalizejs/src/modules/spa.js index 78fbeeb..a60f20a 100755 --- a/packages/signalizejs/src/modules/spa.js +++ b/packages/signalizejs/src/modules/spa.js @@ -99,7 +99,8 @@ export default async ({ params, resolve, root }, config) => { throw new Error('Error during navigation.'); } - const onlyHashChanged = url.pathname === getCurrentLocation().pathname; + const currentLocation = getCurrentLocation(); + const onlyHashChanged = url.pathname === currentLocation.pathname && url.hash !== currentLocation.hash; const shouldTriggerNavigation = !onlyHashChanged; const urlString = url.toString();