Last active
March 31, 2020 15:46
-
-
Save jamigibbs/eaf0ca6e0b6c9f318ee44acd2a72e9b5 to your computer and use it in GitHub Desktop.
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