mirror of
https://dev.azure.com/globalhealthx/EMR/_git/helix-engage
synced 2026-04-11 18:28:15 +00:00
#533: Remove redundant Call History top header (duplicate TopBar) #531: Block logout during active call (confirm dialog + UCID check) #529: Block outbound calls when agent is on Break/Training #527: Remove updatePatient during appointment creation (was mutating shared Patient entity, affecting all past appointments) #547: SLA rules seeded via API (config issue, not code) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -96,10 +96,19 @@ export const AuthProvider = ({ children }: AuthProviderProps) => {
|
||||
}, []);
|
||||
|
||||
const logout = useCallback(async () => {
|
||||
// Block logout during active call
|
||||
const { isOutboundPending, disconnectSip } = await import('@/state/sip-manager');
|
||||
const activeUcid = localStorage.getItem('helix_active_ucid');
|
||||
if (isOutboundPending() || activeUcid) {
|
||||
const confirmed = window.confirm(
|
||||
'You have an active call. Logging out will disconnect the call. Are you sure?',
|
||||
);
|
||||
if (!confirmed) return;
|
||||
}
|
||||
|
||||
// Disconnect SIP before logout
|
||||
try {
|
||||
const { disconnectSip } = await import('@/state/sip-manager');
|
||||
disconnectSip();
|
||||
disconnectSip(true);
|
||||
} catch {}
|
||||
|
||||
// Notify sidecar to unlock Redis session + Ozonetel logout — await before clearing tokens
|
||||
|
||||
Reference in New Issue
Block a user