Small refactoring and logging
This commit is contained in:
parent
0b1b72c27d
commit
1f4d19d2d2
2 changed files with 4 additions and 7 deletions
|
|
@ -23,6 +23,7 @@ const Header = (props: Props) => {
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (cookies.user) {
|
if (cookies.user) {
|
||||||
setUsername(cookies.user.username)
|
setUsername(cookies.user.username)
|
||||||
|
console.log(`Logged in as user "${cookies.user.username}"`)
|
||||||
}
|
}
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
|
|
@ -46,10 +47,6 @@ const Header = (props: Props) => {
|
||||||
window.history.replaceState(null, `Grid Tool`, `/`)
|
window.history.replaceState(null, `Grid Tool`, `/`)
|
||||||
history.go(0)
|
history.go(0)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cookies.user != null) {
|
|
||||||
console.log(`Logged in as user "${cookies.user.username}"`)
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<nav className="Header">
|
<nav className="Header">
|
||||||
|
|
|
||||||
|
|
@ -3,12 +3,12 @@ import { RouteComponentProps } from 'react-router-dom'
|
||||||
|
|
||||||
import Party from '~components/Party'
|
import Party from '~components/Party'
|
||||||
|
|
||||||
interface Props {}
|
interface Props extends RouteComponentProps {}
|
||||||
interface NewProps extends RouteComponentProps<Props> {}
|
|
||||||
|
|
||||||
const NewRoute: React.FC<NewProps> = () => {
|
const NewRoute: React.FC<Props> = () => {
|
||||||
function callback(path: string) {
|
function callback(path: string) {
|
||||||
// This is scuffed, how do we do this natively?
|
// This is scuffed, how do we do this natively?
|
||||||
|
console.log("Callback to rewrite URL called")
|
||||||
window.history.replaceState(null, `Grid Tool`, `${path}`)
|
window.history.replaceState(null, `Grid Tool`, `${path}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue