Small refactoring and logging

This commit is contained in:
Justin Edmund 2020-10-19 00:58:00 -07:00
parent 0b1b72c27d
commit 1f4d19d2d2
2 changed files with 4 additions and 7 deletions

View file

@ -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">

View file

@ -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}`)
}