From 2dfb1d6b979e004ccebfefeaf8a53beaa78034e4 Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Sat, 29 Jan 2022 19:24:46 +0100 Subject: [PATCH] add --- .../services/chat/ws-chat-methods.service.ts | 28 ++++++++++--------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/src/app/services/chat/ws-chat-methods.service.ts b/src/app/services/chat/ws-chat-methods.service.ts index d2e806d88..cd96d15e9 100644 --- a/src/app/services/chat/ws-chat-methods.service.ts +++ b/src/app/services/chat/ws-chat-methods.service.ts @@ -8,6 +8,7 @@ import { Rooms, Update as room } from 'src/app/models/chatMethod'; import { Storage } from '@ionic/storage'; import { Platform } from '@ionic/angular'; import { SqliteService } from 'src/app/services/sqlite.service'; +import { ChatService } from 'src/app/services/chat.service'; import { NativeNotificationService } from 'src/app/services/native-notification.service'; import { SortService } from '../functions/sort.service'; import { chatUser } from 'src/app/models/chatMethod'; @@ -39,7 +40,8 @@ export class WsChatMethodsService { private platform: Platform, private sqlservice: SqliteService, private NativeNotificationService: NativeNotificationService, - private sortService: SortService + private sortService: SortService, + private ChatService: ChatService ) { (async()=>{ await this.getAllRooms(); @@ -314,21 +316,21 @@ export class WsChatMethodsService { async getUser() { - // let _res = await this.chatService.getAllUsers().toPromise() + let _res = await this.ChatService.getAllUsers().toPromise() - // let user = _res['users'].filter(data => data.username != SessionStore.user.RochetChatUser); + let user = _res['users'].filter(data => data.username != SessionStore.user.RochetChatUser); - // user = user.sort((a,b) => { - // if(a.name < b.name) { - // return -1; - // } - // if(a.name > b.name) { - // return 1; - // } - // return 0; - // }); + user = user.sort((a,b) => { + if(a.name < b.name) { + return -1; + } + if(a.name > b.name) { + return 1; + } + return 0; + }); - // this.users = user + this.users = user }