This commit is contained in:
Peter Maquiran
2022-01-29 19:24:46 +01:00
parent ed77e1aea7
commit 2dfb1d6b97
@@ -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
}