Take out all special characters in string

This commit is contained in:
tiago.kayaya
2021-12-10 11:41:24 +01:00
parent e5edac65af
commit d7300080c3
3 changed files with 37 additions and 42 deletions
+16 -27
View File
@@ -8,8 +8,6 @@ import {
ComponentRef,
ComponentFactory,
Output,
AfterViewChecked,
AfterViewInit
} from '@angular/core';
import { ModalController, Platform } from '@ionic/angular';
import { AuthService } from 'src/app/services/auth.service';
@@ -40,7 +38,7 @@ import { SqliteService } from 'src/app/services/sqlite.service';
templateUrl: './chat.page.html',
styleUrls: ['./chat.page.scss'],
})
export class ChatPage implements OnInit, AfterViewInit {
export class ChatPage implements OnInit {
showLoader: boolean;
@@ -164,42 +162,25 @@ export class ChatPage implements OnInit, AfterViewInit {
this.openNewGroupPage();
} */
this.router.events.forEach((event) => {
if (event instanceof NavigationStart && event.url.startsWith('/home/chat')) {
alert('Aqui' + this.dataService.get("newGroup"))
if (this.dataService.get("newGroup")) {
this.openNewGroupPage();
}
/* if (window.location.pathname.split('/').length >= 4 && window.location.pathname.startsWith('/home/chat')) {
alert(this.dataService.get("newGroup"))
else{
this.closeAllDesktopComponents();
this.showEmptyComponent = true;
}
else {
if (this.dataService.get("newGroup")) {
this.openNewGroupPage();
}
} */
}
else{
this.dataService.set("newGroup", false);
}
});
if (this.dataService.get("newGroup")) {
this.openNewGroupPage();
}
}
ngAfterViewInit() {
alert(this.dataService.get("newGroup"))
}
ngAfterViewChecked(){
//alert(this.dataService.get("newGroup"))
}
ngOnDestroy() {
this.setStatus('offline');
this.dataService.set("newGroup", false);
console.log('On Destroy')
}
@@ -513,6 +494,13 @@ export class ChatPage implements OnInit, AfterViewInit {
console.log('Chat list', res);
if (res != 200) {
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
this.userDirectMessages = res.ims.sort((a, b) => {
var dateA = new Date(a._updatedAt).getTime();
var dateB = new Date(b._updatedAt).getTime();
return dateB - dateA;
});
}
//console.log(res.ims);
/* this.userDirectMessages = res.ims.sort((a, b) => {
var dateA = new Date(a._updatedAt).getTime();
@@ -557,9 +545,10 @@ export class ChatPage implements OnInit, AfterViewInit {
this.chatService.getAllUsers().subscribe(res => {
console.log('chatusers', res);
this.transformDataUserList(res['users'])
//this.dmUsers = res['users'].filter(data => data.username != this.loggedUserChat.me.username);
//console.log(this.dmUsers);
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
this.dmUsers = res['users'].filter(data => data.username != this.loggedUserChat.me.username);
console.log(this.dmUsers);
}
});
}