mirror of
https://github.com/jambonz/chrome-extension-dialer.git
synced 2026-01-25 02:08:05 +00:00
Merge pull request #36 from jambonz/feat/fix_phone_keep_retry_connect
fixed the phone online toggle button is not able to turn off when wss is disconnect
This commit is contained in:
@@ -309,18 +309,24 @@ export const Phone = ({
|
|||||||
unregisteredReasonRef.current = "";
|
unregisteredReasonRef.current = "";
|
||||||
}
|
}
|
||||||
setStatus("disconnected");
|
setStatus("disconnected");
|
||||||
if (isRestartRef.current) {
|
setIsOnline(false);
|
||||||
createSipClient();
|
setIsSwitchingUserStatus(false);
|
||||||
isRestartRef.current = false;
|
if (sipUA.current) {
|
||||||
|
sipUA.current.stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (args.error) {
|
if (args.error) {
|
||||||
toast({
|
toast({
|
||||||
title: `Cannot connect to ${sipServerAddress}, ${args.reason}`,
|
title: `Cannot connect to ${sipServerAddress}${
|
||||||
|
args.reason ? `, ${args.reason}` : ""
|
||||||
|
}`,
|
||||||
status: "warning",
|
status: "warning",
|
||||||
duration: DEFAULT_TOAST_DURATION,
|
duration: DEFAULT_TOAST_DURATION,
|
||||||
isClosable: true,
|
isClosable: true,
|
||||||
});
|
});
|
||||||
|
} else if (isRestartRef.current) {
|
||||||
|
createSipClient();
|
||||||
|
isRestartRef.current = false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
// Call Status
|
// Call Status
|
||||||
|
|||||||
Reference in New Issue
Block a user