Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async connect(): Promise {
this.liveshare = await vsls.getApiAsync();
const { id: sessionId } = this.liveshare.session;
this.liveshare.onDidChangePeers(({ added, removed }) => {
if (!!this.hostService) {
this.hostService.updateCachedPeers(added, removed);
}
const { role } = this.liveshare.session;
if (role === vsls.Role.Host) {
this.hostService.sendJoinedMessages(added);
this.hostService.sendLeavingMessages(removed);
}
});
this.liveshare.onDidChangeSession(async ({ session }) => {