From 2a909c1f194682e256b4134e7a1d87278c6f9d45 Mon Sep 17 00:00:00 2001 From: He4eT Date: Thu, 4 Mar 2021 03:17:37 +0500 Subject: [PATCH] Add redirect for GameView --- src/index.js | 6 +++++- src/utils/utils.routing.js | 1 + src/views/HomeView.jsx | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/index.js b/src/index.js index 4055d4a..30fc502 100644 --- a/src/index.js +++ b/src/index.js @@ -1,5 +1,5 @@ import { h, render } from 'preact' -import { Route, Router, Switch } from 'wouter-preact' +import { Route, Router, Redirect, Switch } from 'wouter-preact' import { useHashLocation, @@ -40,6 +40,10 @@ function App () { ...params }} />} + + + {params => { const handler = () => setLoc(currentLoc()) window.addEventListener('hashchange', handler) + handler() return () => window.removeEventListener('hashchange', handler) }, []) diff --git a/src/views/HomeView.jsx b/src/views/HomeView.jsx index d8b03b7..2117d0e 100644 --- a/src/views/HomeView.jsx +++ b/src/views/HomeView.jsx @@ -64,7 +64,7 @@ export default function ({ themeEngine }) {

- + IFDB games