cancel subscription on account deletion

This commit is contained in:
m5r
2021-10-01 20:07:00 +02:00
parent c5f135fdcc
commit 188c028667
6 changed files with 33 additions and 3 deletions

View File

@ -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);

View File

@ -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);
},