From 8f9f0fc8b038bfa0c38fce9aa93a15f773c20895 Mon Sep 17 00:00:00 2001 From: Sharon Kennedy Date: Wed, 5 Feb 2020 20:26:51 -0500 Subject: [PATCH] correctly catch unknown device error --- src/components/chatbox.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/chatbox.jsx b/src/components/chatbox.jsx index a51f602..1b8f191 100644 --- a/src/components/chatbox.jsx +++ b/src/components/chatbox.jsx @@ -150,8 +150,8 @@ class ChatBox extends React.Component { this.chatboxInput.current.focus() }) .catch((err) => { - switch (err["errcode"]) { - case "M_UNKNOWN": // UnknownDeviceError + switch (err["name"]) { + case "UnknownDeviceError": Object.keys(err.devices).forEach((userId) => { Object.keys(err.devices[userId]).map((deviceId) => { this.state.client.setDeviceKnown(userId, deviceId, true);