11 lines
549 B
TypeScript
11 lines
549 B
TypeScript
import { atom } from 'jotai';
|
|
|
|
// Bridge between the native Capacitor push-action listener (which fires outside
|
|
// any React render context) and the in-app call flow. The listener sets the
|
|
// atom; usePendingCallActionConsumer — mounted inside CallEmbedProvider — reads
|
|
// it and triggers useDmCallStart / mx.sendRtcDecline.
|
|
export type PendingCallAction =
|
|
| { kind: 'answer'; roomId: string }
|
|
| { kind: 'decline'; roomId: string; notifEventId: string };
|
|
|
|
export const pendingCallActionAtom = atom<PendingCallAction | undefined>(undefined);
|