Fix page not opening (#359)

This commit is contained in:
maclux authored and GitHub committed 2022-12-13 19:14:09 +03:00
1 parent 7bc208fec3
commit df43e5fcdf
3 files changed
+5 -2

No files matched your search

+3 -1
View File
@@ -6,11 +6,13 @@ import { ArrowLeftIcon, ArrowRightIcon } from './icon/ArrowIcons';
export function ArrowLink({
to,
children,
state,
direction = 'left',
variant = 'flat',
}: {
to: string;
children: ReactNode;
state?: { SerialPort?: string };
direction?: 'left' | 'right';
variant?: 'flat' | 'boxed' | 'boxed-2';
}) {
@@ -31,7 +33,7 @@ export function ArrowLink({
}, [variant]);
return (
<NavLink to={to} className={classes}>
<NavLink to={to} state={state} className={classes}>
{direction === 'left' && (
<div className="flex flex-col justify-center">
<ArrowLeftIcon></ArrowLeftIcon>
@@ -157,6 +157,7 @@ export function ConnectTrackersPage() {
</ArrowLink> */}
<ArrowLink
to="/settings/serial"
state={{ SerialPort: 'Auto' }}
direction="right"
variant={state.alonePage ? 'boxed-2' : 'boxed'}
>
+1 -1
View File
@@ -73,7 +73,7 @@ export function Serial() {
useEffect(() => {
sendRPCPacket(RpcMessage.SerialDevicesRequest, new SerialDevicesRequestT());
const typedState: { serialPort: string } = state as any;
if (typedState.serialPort) {
if (typedState?.serialPort) {
reset({ port: typedState.serialPort });
}
}, []);