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(() => {
|
||||
if (cookies.user) {
|
||||
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`, `/`)
|
||||
history.go(0)
|
||||
}
|
||||
|
||||
if (cookies.user != null) {
|
||||
console.log(`Logged in as user "${cookies.user.username}"`)
|
||||
}
|
||||
|
||||
return (
|
||||
<nav className="Header">
|
||||
|
|
|
|||
|
|
@ -3,12 +3,12 @@ import { RouteComponentProps } from 'react-router-dom'
|
|||
|
||||
import Party from '~components/Party'
|
||||
|
||||
interface Props {}
|
||||
interface NewProps extends RouteComponentProps<Props> {}
|
||||
interface Props extends RouteComponentProps {}
|
||||
|
||||
const NewRoute: React.FC<NewProps> = () => {
|
||||
const NewRoute: React.FC<Props> = () => {
|
||||
function callback(path: string) {
|
||||
// This is scuffed, how do we do this natively?
|
||||
console.log("Callback to rewrite URL called")
|
||||
window.history.replaceState(null, `Grid Tool`, `${path}`)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue