diff --git a/frontend/src/state/AppProvider.tsx b/frontend/src/state/AppProvider.tsx index 0755b0a..000d8e0 100644 --- a/frontend/src/state/AppProvider.tsx +++ b/frontend/src/state/AppProvider.tsx @@ -141,6 +141,18 @@ export function AppProvider({ children }: { children: ReactNode }) { }; }, []); + // Background pairing completes server-side with no push channel to the UI + // (IPC is request/response), so poll for fresh state: otherwise Home and + // Profiles keep showing the pre-pairing snapshot after Amber connects. + // getState is a cheap local vault read; errors are ignored here since every + // screen surfaces its own request failures. + useEffect(() => { + const timer = window.setInterval(() => { + void refresh().catch(() => {}); + }, 5000); + return () => window.clearInterval(timer); + }, [refresh]); + const createProfile = useCallback( async (label: string): Promise => { const result = await api.createProfile(label, state?.settings);