From ec13a0cd8e1db25d3ba4475b7d09e8c777201846 Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Wed, 12 Oct 2022 11:38:04 +0100 Subject: [PATCH] build error fix --- src/_redirects | 1 - src/app/services/chat/room.service.ts | 5 ++ .../new-group/contacts/contacts.page.html | 4 +- .../shared/chat/new-group/new-group.page.ts | 55 ++++++++++--------- .../popover/chat-popover/chat-popover.page.ts | 11 ++-- 5 files changed, 41 insertions(+), 35 deletions(-) delete mode 100644 src/_redirects diff --git a/src/_redirects b/src/_redirects deleted file mode 100644 index b21f6cb71..000000000 --- a/src/_redirects +++ /dev/null @@ -1 +0,0 @@ -/* /index.html 200 \ No newline at end of file diff --git a/src/app/services/chat/room.service.ts b/src/app/services/chat/room.service.ts index d1d6d5c1d..12c98a042 100644 --- a/src/app/services/chat/room.service.ts +++ b/src/app/services/chat/room.service.ts @@ -204,6 +204,11 @@ export class RoomService { } + updateInfo() { + // this.chatService.getRoomInfo(this.id).toPromise(); + + } + get online() { if(!this.isGroup) { diff --git a/src/app/shared/chat/new-group/contacts/contacts.page.html b/src/app/shared/chat/new-group/contacts/contacts.page.html index 1a0b27564..b5e1c8af7 100644 --- a/src/app/shared/chat/new-group/contacts/contacts.page.html +++ b/src/app/shared/chat/new-group/contacts/contacts.page.html @@ -24,7 +24,7 @@ - + @@ -36,7 +36,7 @@ --> - +
{{header}} 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 61aed9ccf..f078d9647 100644 --- a/src/app/shared/chat/new-group/new-group.page.ts +++ b/src/app/shared/chat/new-group/new-group.page.ts @@ -151,33 +151,36 @@ export class NewGroupPage implements OnInit{ createGroupWithAttachments(res: any) { this.ChatSystemService.getGroupRoom(res.result.rid).hasLoadHistory = true; - this.documents.forEach(element => { - this.ChatSystemService.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.documents) { + this.documents.forEach(element => { + this.ChatSystemService.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", - }], - }) - }); + }, + 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", + }], + }) + }); + } + this.ChatSystemService.getAllRooms(); diff --git a/src/app/shared/popover/chat-popover/chat-popover.page.ts b/src/app/shared/popover/chat-popover/chat-popover.page.ts index d0aff2635..4be344d40 100644 --- a/src/app/shared/popover/chat-popover/chat-popover.page.ts +++ b/src/app/shared/popover/chat-popover/chat-popover.page.ts @@ -83,7 +83,7 @@ export class ChatPopoverPage implements OnInit { let body = { "roomId":this.roomId, } let res:any = await this.ChatSystemService.leaveRoom(this.roomId); - this.ChatSystemService.deleteRoom(this.roomId) + if(res.error){ if(res.error.error = "error-you-are-last-owner"){ @@ -98,12 +98,11 @@ export class ChatPopoverPage implements OnInit { this.toastService._badRequest("Não foi possível sair do grupo"); } } - else{ + else { + this.ChatSystemService.deleteRoom(this.roomId) this.close('leave'); } - this.close('leave'); - } //Delete @@ -112,12 +111,12 @@ export class ChatPopoverPage implements OnInit { this.chatService.getRoomInfo(this.roomId).subscribe(room=>{ this.room = room['room']; - if(this.room.t === 'p'){ + if(this.room.t === 'p') { this.chatService.deleteGroup(body).subscribe(res=>{ this.ChatSystemService.deleteRoom(this.roomId) }); } - else{ + else { this.chatService.deleteChannel(body).subscribe(res=>{ this.ChatSystemService.deleteRoom(this.roomId) });