Commit e3cbd33e by qlintonger xeno

眼镜端修复+5

parent 198abd75
......@@ -9,6 +9,7 @@ export class AnyRemote {
infoCB = null
warningCB = null
errorCB = null
messageQueue = []
configureWS(url, tabVisibleCB = () => true, connectionLostCB = () => true, wsSocketChannelName = '') {
this.wsInt = new WSInt(url, this.onMessageGeneral.bind(this), tabVisibleCB, connectionLostCB, wsSocketChannelName)
......@@ -33,6 +34,20 @@ export class AnyRemote {
}
sendWSFromCall(toID, msgType, msgData, channelID) {
if (!this.wsInt) {
this.messageQueue.push({toID, msgType, msgData, channelID})
return
}
if (this.messageQueue.length) {
this.messageQueue.forEach((item) => {
const {toID, msgType, msgData, channelID} = item;
this.wsInt.send({
toID, msgType, msgData, channelID,
fromID: userStates.value.currentUserId,
fromName: userStates.value.currentUserName,
})
})
}
this.wsInt.send({
fromID: userStates.value.currentUserId,
fromName: userStates.value.currentUserName,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment