mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 13:02:56 +00:00
Improve
This commit is contained in:
@@ -176,7 +176,6 @@ export class WsChatMethodsService {
|
||||
await this.storage.remove('Rooms');
|
||||
} catch(e) {}
|
||||
|
||||
console.log(rooms,'=========!+!+!++!+=====')
|
||||
let index = 0
|
||||
|
||||
if(rooms?.result?.update) {
|
||||
@@ -220,7 +219,6 @@ export class WsChatMethodsService {
|
||||
|
||||
|
||||
await this.storage.set('Rooms', rooms);
|
||||
console.log('done get rooms')
|
||||
|
||||
|
||||
setTimeout(() => {
|
||||
@@ -249,7 +247,6 @@ export class WsChatMethodsService {
|
||||
*/
|
||||
subscribeToRoom() {
|
||||
|
||||
console.log('defaultSubtribe', this.dm)
|
||||
|
||||
for (const id in this.dm) {
|
||||
this.defaultSubtribe(id)
|
||||
@@ -259,8 +256,6 @@ export class WsChatMethodsService {
|
||||
this.defaultSubtribe(id)
|
||||
}
|
||||
|
||||
console.log("Done subcribe");
|
||||
|
||||
this.WsChatService.streamNotifyLogged().then((subscription=>{
|
||||
|
||||
}))
|
||||
@@ -287,33 +282,30 @@ export class WsChatMethodsService {
|
||||
* @param id room id
|
||||
*/
|
||||
private defaultSubtribe(id: any) {
|
||||
|
||||
console.log(id, this._dm);
|
||||
|
||||
|
||||
this.WsChatService.streamRoomMessages(id).then((subscription) => {
|
||||
const room = this.getRoomById(id);
|
||||
room.status.receive.message = true;
|
||||
console.log(subscription, "subscription");
|
||||
})
|
||||
|
||||
this.WsChatService.subStreamNotifyRoom(id, 'typing', false).then((subscription) => {
|
||||
const room = this.getRoomById(id);
|
||||
room.status.receive.typing = true;
|
||||
console.log(subscription, "subStreamNotifyRoom");
|
||||
//
|
||||
})
|
||||
|
||||
this.WsChatService.subStreamNotifyRoom(id, 'readMessage', false).then((subscription) => {
|
||||
const room = this.getRoomById(id);
|
||||
room.status.receive.readMessage = true;
|
||||
console.log(subscription, "subStreamNotifyRoom");
|
||||
// console.log(subscription, "subStreamNotifyRoom");
|
||||
//
|
||||
})
|
||||
|
||||
this.WsChatService.streamNotifyRoomDeleteMessage(id).then((subscription) => {
|
||||
const room = this.getRoomById(id);
|
||||
room.status.receive.deleteMessage = true;
|
||||
console.log(subscription);
|
||||
// console.log(subscription);
|
||||
//
|
||||
})
|
||||
}
|
||||
|
||||
@@ -693,7 +693,7 @@ export class WsChatService {
|
||||
onopen: async ()=> {
|
||||
this.ws.connected = true
|
||||
|
||||
console.log("Open connection =====================================================")
|
||||
// console.log("Open connection =====================================================")
|
||||
|
||||
|
||||
setTimeout(()=>{
|
||||
@@ -742,7 +742,7 @@ export class WsChatService {
|
||||
} else {
|
||||
let messageStr = JSON.stringify(message)
|
||||
//
|
||||
console.log(messageStr)
|
||||
// console.log(messageStr)
|
||||
this.socket.send(messageStr)
|
||||
}
|
||||
return requestId
|
||||
@@ -751,13 +751,6 @@ export class WsChatService {
|
||||
onmessage: async (event: any)=> {
|
||||
const data = JSON.parse(event.data)
|
||||
|
||||
console.log(data);
|
||||
|
||||
if(data?.fields?.args?.[0]?.msg?.includes("hello")) {
|
||||
console.log(data);
|
||||
alert("message");
|
||||
}
|
||||
|
||||
for (const [key, value] of Object.entries(this.wsCallbacks)) {
|
||||
if(value.type== 'Onmessage') {
|
||||
const dontRepeat = await value.funx(data)
|
||||
@@ -779,7 +772,7 @@ export class WsChatService {
|
||||
|
||||
this.connect()
|
||||
this.login()
|
||||
console.log("close connection ===============================");
|
||||
// console.log("close connection ===============================");
|
||||
|
||||
for (const [key, value] of Object.entries(this.wsCallbacks)) {
|
||||
if(value.type == 'Offline') {
|
||||
|
||||
Reference in New Issue
Block a user