From 7a2a21ec706bb5169088d9fcce7d16bfac0441b2 Mon Sep 17 00:00:00 2001 From: "tiago.kayaya" Date: Fri, 10 Dec 2021 11:46:28 +0100 Subject: [PATCH] Take out all special characters in string --- src/app/pages/chat/new-group/new-group.page.ts | 1 + src/app/shared/chat/new-group/new-group.page.ts | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/app/pages/chat/new-group/new-group.page.ts b/src/app/pages/chat/new-group/new-group.page.ts index 9042db2fd..d1006c0e2 100644 --- a/src/app/pages/chat/new-group/new-group.page.ts +++ b/src/app/pages/chat/new-group/new-group.page.ts @@ -57,6 +57,7 @@ export class NewGroupPage implements OnInit { createGroup(){ let name = this.groupName.split(' ').join('-'); + //Take out all special characters in string name = name.normalize("NFD").replace(/[\u0300-\u036f]/g, ""); let body = { "name":name, } this.chatService.addGroup(body).subscribe(res=>{ diff --git a/src/app/shared/chat/new-group/new-group.page.ts b/src/app/shared/chat/new-group/new-group.page.ts index 96bd41d83..a8fb7a4c5 100644 --- a/src/app/shared/chat/new-group/new-group.page.ts +++ b/src/app/shared/chat/new-group/new-group.page.ts @@ -41,13 +41,11 @@ export class NewGroupPage implements OnInit{ { this.isGroupCreated = false; //this.groupName = this.navParams.get('name'); - alert('New group '+this.dataService.get("newGroup")) } ngOnInit() { this.router.events.forEach((event) => { if (event instanceof NavigationStart && event.url.startsWith('/home/chat')) { - alert('New group '+this.dataService.get("newGroup")) if (this.dataService.get("newGroup")) { this.task = this.dataService.get("task"); this.groupName = this.task.Folio;