Maybe fix appUrlOpen

This commit is contained in:
benthecarman
2024-06-10 14:04:50 -05:00
committed by Tony Giorgio
parent 850e3478be
commit 65fe31c72f

View File

@@ -74,20 +74,6 @@ if (Capacitor.isNativePlatform()) {
function ChildrenOrError(props: { children: JSX.Element }) { function ChildrenOrError(props: { children: JSX.Element }) {
const [state] = useMegaStore(); const [state] = useMegaStore();
return (
<Switch>
<Match when={state.setup_error}>
<SetupErrorDisplay
initialError={state.setup_error!}
password={state.password}
/>
</Match>
<Match when={true}>{props.children}</Match>
</Switch>
);
}
export function Router() {
// listeners for native navigation handling // listeners for native navigation handling
// Check if the platform is Android to handle back // Check if the platform is Android to handle back
onMount(async () => { onMount(async () => {
@@ -120,10 +106,15 @@ export function Router() {
const path = url.pathname; const path = url.pathname;
const urlParams = new URLSearchParams(url.search); const urlParams = new URLSearchParams(url.search);
console.log( if (urlParams.size) {
`Navigating to ${path}?${urlParams.toString()}` console.log(
); `Navigating to ${path}?${urlParams.toString()}`
navigate(`${path}?${urlParams.toString()}`); );
navigate(`${path}?${urlParams.toString()}`);
} else {
console.log(`Navigating to ${path}`);
navigate(path);
}
} }
); );
@@ -133,6 +124,21 @@ export function Router() {
}); });
} }
}); });
return (
<Switch>
<Match when={state.setup_error}>
<SetupErrorDisplay
initialError={state.setup_error!}
password={state.password}
/>
</Match>
<Match when={true}>{props.children}</Match>
</Switch>
);
}
export function Router() {
return ( return (
<SolidRouter <SolidRouter
root={(props) => ( root={(props) => (