fix notification

This commit is contained in:
Peter Maquiran
2022-01-29 17:06:25 +01:00
parent 2a0744e9ae
commit db987b00f9
5 changed files with 18 additions and 14 deletions
+1 -3
View File
@@ -280,7 +280,7 @@ export class RoomService {
if (this.hasLoadHistory) { return false }
this.storage.get('chatmsg' + this.id).then((messages = [])=>{
this.storage.get('chatmsg' + this.id).then((messages = []) => {
let localMessages = []
@@ -296,7 +296,6 @@ export class RoomService {
this.WsChatService.loadHistory(this.id, limit).then((chatHistory:chatHistory) => {
console.log('loadHistory', chatHistory)
let localMessages = []
chatHistory.result.messages.reverse().forEach(message => {
@@ -311,7 +310,6 @@ export class RoomService {
this.storage.set('chatmsg' + this.id, chatHistory.result.messages.reverse())
})
/* this.WsChatService.loadHistory(this.id, limit).then(async (chatHistory: chatHistory) => {
@@ -119,13 +119,13 @@ export class WsChatMethodsService {
subscribeToRoomUpdate(id, roomData) {
this.WsChatService.streamRoomMessages(id).then((subscription)=>{
this.WsChatService.streamRoomMessages(id).then((subscription)=> {
console.log('streamRoomMessages', subscription)
})
this.WsChatService.streamRoomMessages(id).then((subscription)=>{
this.WsChatService.streamRoomMessages(id).then((subscription) => {
console.log('streamRoomMessages', subscription)
})
this.WsChatService.streamNotifyLogged().then((subscription=>{
this.WsChatService.streamNotifyLogged().then((subscription=> {
console.log('streamRoomMessages', subscription)
}))
this.WsChatService.streamNotifyRoomDeleteMessage(id).then((subscription)=>{
@@ -138,7 +138,7 @@ export class WsChatMethodsService {
}
prepareRoom(roomData){
prepareRoom(roomData) {
let room:RoomService;
room = new RoomService(this.WsChatService, new MessageService(this.storage), this.storage, this.platform, this.sqlservice, this.NativeNotificationService)
+3 -3
View File
@@ -302,7 +302,7 @@ export class WsChatService {
return new Promise((resolve, reject) => {
this.ws.registerCallback({type:'Onmessage', funx:(message)=>{
if(message.id == requestId || deepFind(message,'result.id') == requestId) { // same request send
resolve('')
resolve(message)
return true
}
}})
@@ -331,7 +331,7 @@ export class WsChatService {
return new Promise((resolve, reject) => {
this.ws.registerCallback({type:'Onmessage', funx:(message)=>{
if(message.id == requestId ) { // same request send
resolve('')
resolve(message)
return true
}
}})
@@ -517,7 +517,7 @@ updateRoomEventss(roomId, collection:string, funx: Function, ) {
return new Promise((resolve, reject) => {
this.ws.registerCallback({type:'Onmessage', funx:(message)=>{
if(message.id == requestId || deepFind(message,'result.id') == requestId) { // same request send
resolve('')
resolve(message)
return true
}
}})