cancel subscription on account deletion
This commit is contained in:
@ -54,6 +54,7 @@ export default function useDevice() {
|
||||
device.on("incoming", onDeviceIncoming);
|
||||
|
||||
return () => {
|
||||
// TODO: device.off is not a function
|
||||
device.off("registered", onDeviceRegistered);
|
||||
device.off("unregistered", onDeviceUnregistered);
|
||||
device.off("error", onDeviceError);
|
||||
|
@ -86,6 +86,7 @@ export default function useMakeCall({ recipient, onHangUp }: Params) {
|
||||
device?.destroy();
|
||||
onHangUp?.();
|
||||
router.replace(Routes.KeypadPage());
|
||||
// TODO: outgoingConnection.off is not a function
|
||||
outgoingConnection?.off("cancel", endCall);
|
||||
outgoingConnection?.off("disconnect", endCall);
|
||||
},
|
||||
|
Reference in New Issue
Block a user