refactor: tighten types and reuse instrument UI
This commit is contained in:
@@ -30,8 +30,11 @@ const Public: FC<PropsWithChildren> = (props) => {
|
||||
|
||||
if (!ready) return <RouteSkeleton variant="shell" />;
|
||||
|
||||
const requested = (location.state as null
|
||||
| { returnTo?: string })?.returnTo;
|
||||
const state: unknown = location.state;
|
||||
|
||||
const requested = state && typeof state === "object" && "returnTo" in state
|
||||
? state.returnTo
|
||||
: undefined;
|
||||
|
||||
const returnTo
|
||||
= typeof requested === "string"
|
||||
|
||||
Reference in New Issue
Block a user