mirror of
https://github.com/He4eT/elseifplayer.git
synced 2026-05-05 01:17:22 +00:00
Add redirect for GameView
This commit is contained in:
parent
9e4e101495
commit
2a909c1f19
3 changed files with 7 additions and 2 deletions
|
|
@ -1,5 +1,5 @@
|
||||||
import { h, render } from 'preact'
|
import { h, render } from 'preact'
|
||||||
import { Route, Router, Switch } from 'wouter-preact'
|
import { Route, Router, Redirect, Switch } from 'wouter-preact'
|
||||||
|
|
||||||
import {
|
import {
|
||||||
useHashLocation,
|
useHashLocation,
|
||||||
|
|
@ -40,6 +40,10 @@ function App () {
|
||||||
...params
|
...params
|
||||||
}} />}
|
}} />}
|
||||||
</Route>
|
</Route>
|
||||||
|
<Route path='/games'>
|
||||||
|
<Redirect
|
||||||
|
to={`/games/${themeEngine.currentTheme}/`} />
|
||||||
|
</Route>
|
||||||
<Route path='/play/:theme/:encodedUrl'>
|
<Route path='/play/:theme/:encodedUrl'>
|
||||||
{params => <PlayerView {...{
|
{params => <PlayerView {...{
|
||||||
...themeEngine,
|
...themeEngine,
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@ export const useHashLocation = () => {
|
||||||
const handler = () => setLoc(currentLoc())
|
const handler = () => setLoc(currentLoc())
|
||||||
|
|
||||||
window.addEventListener('hashchange', handler)
|
window.addEventListener('hashchange', handler)
|
||||||
|
handler()
|
||||||
return () => window.removeEventListener('hashchange', handler)
|
return () => window.removeEventListener('hashchange', handler)
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -64,7 +64,7 @@ export default function ({ themeEngine }) {
|
||||||
</h3>
|
</h3>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
<Link href={`/games/${themeEngine.currentTheme}`}>
|
<Link href={`/#/games/${themeEngine.currentTheme}`}>
|
||||||
IFDB games
|
IFDB games
|
||||||
</Link>
|
</Link>
|
||||||
</p>
|
</p>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue