feat: feature/mvp-sprint-1 Fixed navigation edit/editor/things mode change issue

This commit is contained in:
Nikolaj Frey 2023-08-16 10:31:20 +10:00
parent f7f3e7cf28
commit d8343fdd40

View File

@ -49,6 +49,9 @@ export const Nav = (props) => {
if (pathname.slice(0, 7) === "/things") { if (pathname.slice(0, 7) === "/things") {
const newPathname = pathname.replace("/things", "/edit") const newPathname = pathname.replace("/things", "/edit")
navigate(newPathname) navigate(newPathname)
} else if (pathname.slice(0, 7) === "/editor") {
const newPathname = pathname.replace("/editor", "/things")
navigate(newPathname)
} else if (pathname.slice(0, 5) === "/edit") { } else if (pathname.slice(0, 5) === "/edit") {
const newPathname = pathname.replace("/edit", "/things") const newPathname = pathname.replace("/edit", "/things")
navigate(newPathname) navigate(newPathname)