* feat: make relay opt-in for device pairing * fix(relay): keep pairing state authoritative * fix(relay): refresh pairing state across transports * fix(onboard): honor explicit relay opt-out * fix(relay): surface transport startup failures * fix(pairing): gate offers for older daemons * test(cli): rely on real pairing transport coverage * fix(cli): report live relay without a pid file * fix(relay): synchronize config during daemon startup * fix(relay): preserve mutability for ignored overrides * fix(cli): use reachable daemon for pairing * fix(app): redirect invalid pair device routes * fix(pairing): support remote host device pairing Keep Pair Device host-relative through the existing settings and daemon RPC flow. Route CLI output through an injected adapter so workflow tests do not mutate process globals. * fix(pairing): validate pairing destinations Expose the host-relative Pair Device flow on every supported app platform. Reject a reachable daemon whose identity does not match the requested Paseo home before reading or mutating its pairing state. * fix(pairing): render QR codes across platforms Generate SVG text without DOM or canvas and render it through the existing cross-platform SVG stack. * fix(cli): pair from persisted relay state Allow explicit relay pairing while the daemon is stopped when relay is already enabled in persisted configuration.
35 lines
961 B
TypeScript
35 lines
961 B
TypeScript
import { useMemo } from "react";
|
|
import { useTranslation } from "react-i18next";
|
|
import { AdaptiveModalSheet, type SheetHeader } from "@/components/adaptive-modal-sheet";
|
|
import { PairDeviceSection } from "@/desktop/components/pair-device-section";
|
|
|
|
export interface PairDeviceModalProps {
|
|
serverId: string;
|
|
visible: boolean;
|
|
onClose: () => void;
|
|
testID?: string;
|
|
}
|
|
|
|
const SNAP_POINTS: string[] = ["72%", "92%"];
|
|
|
|
export function PairDeviceModal({ serverId, visible, onClose, testID }: PairDeviceModalProps) {
|
|
const { t } = useTranslation();
|
|
const header = useMemo<SheetHeader>(
|
|
() => ({ title: t("settings.host.pairDevices.rowTitle") }),
|
|
[t],
|
|
);
|
|
|
|
return (
|
|
<AdaptiveModalSheet
|
|
header={header}
|
|
visible={visible}
|
|
onClose={onClose}
|
|
snapPoints={SNAP_POINTS}
|
|
desktopMaxWidth={480}
|
|
testID={testID}
|
|
>
|
|
<PairDeviceSection serverId={serverId} onClose={onClose} />
|
|
</AdaptiveModalSheet>
|
|
);
|
|
}
|