StackedRouter: fix duplicated '?' symbol
All checks were successful
/ depoly (push) Successful in 1m28s

This commit is contained in:
thislight 2024-12-23 18:33:18 +08:00
parent 771de51228
commit 71bdb21602
No known key found for this signature in database
GPG key ID: FCFE5192241CCD4E

View file

@ -1,5 +1,4 @@
import { import {
Router,
type RouterProps, type RouterProps,
type StaticRouterProps, type StaticRouterProps,
createRouter, createRouter,
@ -16,9 +15,6 @@ import {
useContext, useContext,
onCleanup, onCleanup,
type Accessor, type Accessor,
children,
createSignal,
createRoot,
} from "solid-js"; } from "solid-js";
import { createStore, unwrap } from "solid-js/store"; import { createStore, unwrap } from "solid-js/store";
import "./StackedRouter.css"; import "./StackedRouter.css";
@ -578,11 +574,11 @@ const StackedRouter: Component<StackedRouterProps> = (oprops) => {
createRenderEffect(() => createRenderEffect(() =>
untrack(() => { untrack(() => {
if (stack.length === 0) { if (stack.length === 0) {
const parts = [window.location.pathname] as string[] const parts = [window.location.pathname] as string[];
if (window.location.search) { if (window.location.search) {
parts.push("?", window.location.search) parts.push(window.location.search);
} }
pushFrame(parts.join(''), { pushFrame(parts.join(""), {
replace: "all", replace: "all",
}); });
} }