Skip to content
Snippets Groups Projects
Commit 67dd077e authored by Jakob Moser's avatar Jakob Moser
Browse files

Merge branch 'fix-stacking-next-query-params' into 'master'

Fix stacking query parameter

Closes #24

See merge request !12
parents e9699ae6 aef53cd0
No related branches found
No related tags found
1 merge request!12Fix stacking query parameter
Pipeline #6543 failed
import { NavPageLink } from "./NavPageLink.mjs" import { NavPageLink } from "./NavPageLink.mjs"
import { logout, isLoggedIn } from "../../account.mjs" import { logout, isLoggedIn } from "../../account.mjs"
const hasQueryParam = (param, path) => param in m.parsePathname(path).params
export const Nav = { export const Nav = {
view() { view() {
return m("nav.box", [ return m("nav.box", [
...@@ -60,7 +62,9 @@ export const Nav = { ...@@ -60,7 +62,9 @@ export const Nav = {
iconOnly: true, iconOnly: true,
}) })
: m(NavPageLink, { : m(NavPageLink, {
href: `/login?next=${m.route.get() || "/"}`, href: hasQueryParam("next", m.route.get())
? m.route.get()
: `/login?next=${m.route.get() || "/"}`,
label: " Anmelden", label: " Anmelden",
icon: "fa-solid fa-right-to-bracket", icon: "fa-solid fa-right-to-bracket",
}), }),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment