add subscribe

This commit is contained in:
Peter Maquiran
2022-01-10 11:29:02 +01:00
parent b5046123de
commit 7a28f2e314
2 changed files with 12 additions and 4 deletions
+9 -1
View File
@@ -107,8 +107,16 @@ export class HomePage implements OnInit {
}).then((message)=>{
// alert('login')
console.log('rocket chat login successfully', message)
this.RocketChatClientService.getRooms().then((rooms)=>{
this.RocketChatClientService.getRooms().then((rooms: any)=>{
console.log('rooms', rooms)
rooms.result.update.forEach((room:any) => {
console.log('room', room)
this.RocketChatClientService.subscribe(room.lastMessage.rid).then((subscription)=>{
console.log('subscription', subscription)
})
});
})
}).catch((message)=>{
console.log('rocket chat login failed', message)