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:
@@ -669,8 +669,7 @@ export class RoomService {
|
||||
|
||||
const messages = await MessageModel.filter({rid:this.id}).execute()
|
||||
|
||||
await messages.forEach( async (ChatMessage, index) => {
|
||||
|
||||
for (let ChatMessage of messages) {
|
||||
const wewMessage = await this.simplePrepareMessage(ChatMessage)
|
||||
|
||||
if(wewMessage.offline == false) {
|
||||
@@ -694,9 +693,8 @@ export class RoomService {
|
||||
if(wewMessage.delate && !wewMessage.offline && !wewMessage.delateRequest) {
|
||||
this.sendDeleteRequest(wewMessage._id)
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
setTimeout(()=> {
|
||||
this.scrollDown()
|
||||
}, 50)
|
||||
|
||||
@@ -153,11 +153,10 @@ export class WsChatMethodsService {
|
||||
const rooms = await this.storage.get('Rooms');
|
||||
|
||||
|
||||
|
||||
if(rooms) {
|
||||
await rooms.result.update.forEach( async (roomData: room) => {
|
||||
for (let roomData of rooms.result.update) {
|
||||
await this.prepareRoom(roomData);
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -172,7 +171,7 @@ export class WsChatMethodsService {
|
||||
async getAllRooms () {
|
||||
this.loadingWholeList = true
|
||||
const rooms = await this.WsChatService.getRooms();
|
||||
try {
|
||||
try {
|
||||
await this.storage.remove('Rooms');
|
||||
} catch(e) {}
|
||||
|
||||
@@ -219,6 +218,7 @@ export class WsChatMethodsService {
|
||||
|
||||
|
||||
await this.storage.set('Rooms', rooms);
|
||||
console.log("Done")
|
||||
|
||||
|
||||
setTimeout(() => {
|
||||
@@ -247,7 +247,7 @@ export class WsChatMethodsService {
|
||||
*/
|
||||
subscribeToRoom() {
|
||||
|
||||
|
||||
console.log('subcribe/////////////////////////////////')
|
||||
for (const id in this.dm) {
|
||||
this.defaultSubtribe(id)
|
||||
}
|
||||
@@ -283,7 +283,6 @@ export class WsChatMethodsService {
|
||||
*/
|
||||
private defaultSubtribe(id: any) {
|
||||
|
||||
|
||||
this.WsChatService.streamRoomMessages(id).then((subscription) => {
|
||||
const room = this.getRoomById(id);
|
||||
room.status.receive.message = true;
|
||||
|
||||
Reference in New Issue
Block a user