mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
fix chat room names
This commit is contained in:
@@ -42,7 +42,12 @@ export class EditGroupPage implements OnInit {
|
||||
this.chatService.getRoomInfo(this.roomId).subscribe(room=>{
|
||||
this.room = room['room'];
|
||||
|
||||
this.groupName = this.room.name.split('-').join(' ');
|
||||
try {
|
||||
this.groupName = this.room.name.split('-').join(' ');
|
||||
} catch (error) {
|
||||
this.groupName = this.room.name;
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Component, OnChanges, OnInit, Input, SimpleChanges, ChangeDetectorRef, Output, EventEmitter, ViewChild, ElementRef, AfterViewInit, OnDestroy } from '@angular/core';
|
||||
import { Component, OnChanges, OnInit, Input, SimpleChanges, ChangeDetectorRef, Output, EventEmitter, ViewChild, ElementRef, AfterViewInit, OnDestroy, ComponentFactoryResolver } from '@angular/core';
|
||||
import { AnimationController, ModalController, PopoverController, Platform } from '@ionic/angular';
|
||||
import { AlertService } from 'src/app/services/alert.service';
|
||||
import { AuthService } from 'src/app/services/auth.service';
|
||||
@@ -411,7 +411,12 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
||||
// console.log('ROOM',room)
|
||||
this.room = room['room'];
|
||||
if (this.room.name) {
|
||||
this.roomName = this.room.name.split('-').join(' ');
|
||||
try {
|
||||
this.roomName = this.room.name.split('-').join(' ');
|
||||
} catch (error) {
|
||||
this.roomName = this.room.name;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -591,7 +596,14 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
||||
this.openEditGroupPage.emit(this.roomId);
|
||||
}
|
||||
else {
|
||||
this.roomName = res.data.name.split('-').join(' ');
|
||||
try {
|
||||
this.roomName = res.data.name.split('-').join(' ');
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
console.log(res.data)
|
||||
this.roomName = res.data.name
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -1139,7 +1139,12 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
// console.log('ROOM',room)
|
||||
this.room = room['room'];
|
||||
if (this.room.name) {
|
||||
this.roomName = this.room.name.split('-').join(' ');
|
||||
try {
|
||||
this.roomName = this.room.name.split('-').join(' ');
|
||||
} catch(error) {
|
||||
this.roomName = this.room.name;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user