mirror of
https://dev.azure.com/globalhealthx/EMR/_git/helix-engage
synced 2026-04-11 18:28:15 +00:00
refactor: centralise outbound dial into useSip().dialOutbound()
- Single dialOutbound() in sip-provider handles all outbound state: callState, callerNumber, outboundPending, API call, error recovery - ClickToCallButton, PhoneActionCell, Dialler all use dialOutbound() - Removed direct Jotai atom manipulation from calling components - Removed setOutboundPending imports from components - SIP disconnects on provider unmount + auth logout - Dialler input is now editable (type or numpad) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -96,6 +96,12 @@ export const AuthProvider = ({ children }: AuthProviderProps) => {
|
||||
}, []);
|
||||
|
||||
const logout = useCallback(async () => {
|
||||
// Disconnect SIP before logout
|
||||
try {
|
||||
const { disconnectSip } = await import('@/state/sip-manager');
|
||||
disconnectSip();
|
||||
} catch {}
|
||||
|
||||
// Notify sidecar to unlock Redis session + Ozonetel logout — await before clearing tokens
|
||||
const token = localStorage.getItem('helix_access_token');
|
||||
if (token) {
|
||||
|
||||
Reference in New Issue
Block a user