当前位置:网站首页>Im web demo invite end hang up error avoidance

Im web demo invite end hang up error avoidance

2022-06-23 02:45:00 A good man

From now on Downloaded from the official website IM web End Demo If you send an invitation and hang up, the following error will be reported , This will cause the hang up exception , So how does this problem arise and how to avoid it ?

The invitation end hangs up abnormally

Cause analysis

Print as shown in the following figure res We know the value of trtcCalling hangup Method returns a with no return value promise, An error will be reported if the value is taken later , Cause exception

Print res value
return undefined

So is it normal for us to comment out this value , After testing . Note that you can hang up normally , But there is a problem , The page after hang up does not show hang up ( Cancel the call ) The news of

Comment out value
Message display exception

You can see from the commented out code logic , The reason for taking this value is to put this message pusher To the message list . But how can I get and add the return value without it at present .

Avoid scheme

At present, there seems to be no good way to take values , We can only save the country by curving . I think that as long as the hang up signaling is successfully sent , You can pull the message list again . So I refreshed the next page and pulled the message list after logging in again , Sure enough, I got it .

Log out and pull the message list again , Normal pulling

There is no need to show off here , Adjust directly after hanging up getMessageList Since the message list is not updated, the direct call will report ’ No more news ‘ A hint of , After the test, the callback after the hang up succeeds is added with this.$store.dispatch('checkoutConversation', this.currentConversation.conversationID) The message display is normal after hanging up .

Add the exception logic to avoid message presentation
Message display is normal

thus , This problem is perfectly avoided , If it helps you , Please give me a compliment !

原网站

版权声明
本文为[A good man]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/01/202201291803163468.html