mirror of
https://github.com/soconnor0919/hristudio.git
synced 2026-03-24 03:37:51 -04:00
feat: Implement digital signatures for participant consent and introduce study forms management.
This commit is contained in:
@@ -1,19 +1,21 @@
|
||||
import * as React from "react"
|
||||
import * as React from "react";
|
||||
|
||||
const MOBILE_BREAKPOINT = 768
|
||||
const MOBILE_BREAKPOINT = 768;
|
||||
|
||||
export function useIsMobile() {
|
||||
const [isMobile, setIsMobile] = React.useState<boolean | undefined>(undefined)
|
||||
const [isMobile, setIsMobile] = React.useState<boolean | undefined>(
|
||||
undefined,
|
||||
);
|
||||
|
||||
React.useEffect(() => {
|
||||
const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`)
|
||||
const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);
|
||||
const onChange = () => {
|
||||
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT)
|
||||
}
|
||||
mql.addEventListener("change", onChange)
|
||||
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT)
|
||||
return () => mql.removeEventListener("change", onChange)
|
||||
}, [])
|
||||
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
|
||||
};
|
||||
mql.addEventListener("change", onChange);
|
||||
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
|
||||
return () => mql.removeEventListener("change", onChange);
|
||||
}, []);
|
||||
|
||||
return !!isMobile
|
||||
return !!isMobile;
|
||||
}
|
||||
|
||||
@@ -39,11 +39,13 @@ export interface UseWizardRosReturn {
|
||||
};
|
||||
},
|
||||
) => Promise<RobotActionExecution>;
|
||||
callService: (service: string, args?: Record<string, unknown>) => Promise<any>;
|
||||
callService: (
|
||||
service: string,
|
||||
args?: Record<string, unknown>,
|
||||
) => Promise<any>;
|
||||
setAutonomousLife: (enabled: boolean) => Promise<boolean>;
|
||||
}
|
||||
|
||||
|
||||
export function useWizardRos(
|
||||
options: UseWizardRosOptions = {},
|
||||
): UseWizardRosReturn {
|
||||
@@ -110,7 +112,10 @@ export function useWizardRos(
|
||||
if (!service) return;
|
||||
|
||||
const handleConnected = () => {
|
||||
console.log("[useWizardRos] handleConnected called, mountedRef:", mountedRef.current);
|
||||
console.log(
|
||||
"[useWizardRos] handleConnected called, mountedRef:",
|
||||
mountedRef.current,
|
||||
);
|
||||
// Set state immediately, before checking mounted status
|
||||
setIsConnected(true);
|
||||
setIsConnecting(false);
|
||||
@@ -237,7 +242,10 @@ export function useWizardRos(
|
||||
) {
|
||||
const timeoutId = setTimeout(() => {
|
||||
connect().catch((error) => {
|
||||
console.warn("[useWizardRos] Auto-connect failed (retrying manually):", error instanceof Error ? error.message : error);
|
||||
console.warn(
|
||||
"[useWizardRos] Auto-connect failed (retrying manually):",
|
||||
error instanceof Error ? error.message : error,
|
||||
);
|
||||
// Don't retry automatically - let user manually connect
|
||||
});
|
||||
}, 100); // Small delay to prevent immediate connection attempts
|
||||
|
||||
Reference in New Issue
Block a user