forked from Github/ocrcc-chatbox
correctly catch unknown device error
This commit is contained in:
parent
620f7017f3
commit
8f9f0fc8b0
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user