correctly catch unknown device error

This commit is contained in:
Sharon Kennedy 2020-02-05 20:26:51 -05:00
parent 620f7017f3
commit 8f9f0fc8b0

View File

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