mirror of
https://github.com/jambonz/chrome-extension-dialer.git
synced 2025-12-19 04:47:45 +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 = "";
|
||||
}
|
||||
setStatus("disconnected");
|
||||
if (isRestartRef.current) {
|
||||
createSipClient();
|
||||
isRestartRef.current = false;
|
||||
setIsOnline(false);
|
||||
setIsSwitchingUserStatus(false);
|
||||
if (sipUA.current) {
|
||||
sipUA.current.stop();
|
||||
}
|
||||
|
||||
if (args.error) {
|
||||
toast({
|
||||
title: `Cannot connect to ${sipServerAddress}, ${args.reason}`,
|
||||
title: `Cannot connect to ${sipServerAddress}${
|
||||
args.reason ? `, ${args.reason}` : ""
|
||||
}`,
|
||||
status: "warning",
|
||||
duration: DEFAULT_TOAST_DURATION,
|
||||
isClosable: true,
|
||||
});
|
||||
} else if (isRestartRef.current) {
|
||||
createSipClient();
|
||||
isRestartRef.current = false;
|
||||
}
|
||||
});
|
||||
// Call Status
|
||||
|
||||
Reference in New Issue
Block a user