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 f2f013e5d..2c11354f5 100644 --- a/src/app/shared/chat/new-group/new-group.page.ts +++ b/src/app/shared/chat/new-group/new-group.page.ts @@ -76,9 +76,8 @@ export class NewGroupPage implements OnInit{ } } - close(){ - //this.modalController.dismiss(); - + close() { + this.addGroupMessage.emit(); } @@ -109,36 +108,71 @@ export class NewGroupPage implements OnInit{ this.addGroupMessage.emit(res.result.rid); await this.wsChatMethodsService.getAllRooms(); - setTimeout(()=> { - this.documents.forEach(element => { - this.wsChatMethodsService.getGroupRoom(res.result.rid).send({ - file: { - "name": element.Assunto, - "type": "application/webtrix", - "ApplicationId": element.ApplicationId, - "DocId": element.DocId, - "Assunto": element.Assunto, - }, - temporaryData: { - data: { - selected: { - Id: element.DocId, - ApplicationType: element.ApplicationId + if(this.wsChatMethodsService.getGroupRoom(res.result.rid)) { + setTimeout(()=> { + this.documents.forEach(element => { + this.wsChatMethodsService.getGroupRoom(res.result.rid).send({ + file: { + "name": element.Assunto, + "type": "application/webtrix", + "ApplicationId": element.ApplicationId, + "DocId": element.DocId, + "Assunto": element.Assunto, + }, + temporaryData: { + data: { + selected: { + Id: element.DocId, + ApplicationType: element.ApplicationId + } } - } - }, - attachments: [{ - "title": element.Assunto, - "description": element.Assunto, - "title_link_download": true, - "type": "webtrix", - "text": element.Assunto, - "thumb_url": "https://static.ichimura.ed.jp/uploads/2017/10/pdf-icon.png", - }], - }) - }); - - }, 500) + }, + attachments: [{ + "title": element.Assunto, + "description": element.Assunto, + "title_link_download": true, + "type": "webtrix", + "text": element.Assunto, + "thumb_url": "https://static.ichimura.ed.jp/uploads/2017/10/pdf-icon.png", + }], + }) + }); + + }, 1500) + } else { + setTimeout(()=> { + this.documents.forEach(element => { + this.wsChatMethodsService.getGroupRoom(res.result.rid).send({ + file: { + "name": element.Assunto, + "type": "application/webtrix", + "ApplicationId": element.ApplicationId, + "DocId": element.DocId, + "Assunto": element.Assunto, + }, + temporaryData: { + data: { + selected: { + Id: element.DocId, + ApplicationType: element.ApplicationId + } + } + }, + attachments: [{ + "title": element.Assunto, + "description": element.Assunto, + "title_link_download": true, + "type": "webtrix", + "text": element.Assunto, + "thumb_url": "https://static.ichimura.ed.jp/uploads/2017/10/pdf-icon.png", + }], + }) + }); + + }, 500) + } + + } else {