Enter and leave chat
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
handleEnterChat() { | |
setUserChatActive() | |
.then((res) => { | |
this.isChatActive = res.Chat_Active__c; | |
this._socket.emit('userEnteredChat'); | |
return refreshApex(this.wiredChatUsers); | |
}) | |
.catch(error => { | |
// eslint-disable-next-line no-console | |
console.error('handleEnterChat error', error); | |
this.error = 'Error updating user record'; | |
}); | |
} | |
handleLeaveChat() { | |
setUserChatInactive() | |
.then((res) => { | |
this.isChatActive = res.Chat_Active__c; | |
this._socket.emit('userLeftChat'); | |
return refreshApex(this.wiredChatUsers); | |
}) | |
.catch(error => { | |
// eslint-disable-next-line no-console | |
console.error('handleLeaveChat error', error); | |
this.error = 'Error updating user record'; | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment