Reloading page when back button is used.

This commit is contained in:
2024-03-19 03:17:19 +01:00
parent e069fb71b9
commit 95e02d30af
2 changed files with 11 additions and 0 deletions

View File

@@ -1,3 +1,5 @@
import events from './events.js';
export default function navigate(path, query, options = {}) {
const curatedQuery = Object.fromEntries(Object.entries(query || {}).map(([key, value]) => (value === undefined ? null : [key, value])).filter(Boolean));
@@ -17,4 +19,6 @@ export default function navigate(path, query, options = {}) {
} else {
history.pushState({}, '', url); // eslint-disable-line no-restricted-globals
}
events.emit('route', url);
}