fix bug lasMessage

This commit is contained in:
tiago.kayaya
2021-10-07 15:30:36 +01:00
parent 19a0076a4d
commit 5d1f0d2705
11 changed files with 36 additions and 21 deletions
+1 -1
View File
@@ -65,7 +65,7 @@
</div>
<div class="item-date" [class.item-date-active]="dm._id == idSelected">{{showDateDuration(dm._updatedAt)}}</div>
</div>
<div class="item-description" [class.item-description-active]="dm._id == idSelected">
<div *ngIf="dm.lastMessage" class="item-description" [class.item-description-active]="dm._id == idSelected">
<ion-label *ngIf="dm.lastMessage">{{dm.lastMessage.msg}}</ion-label>
<ion-label *ngIf="dm.lastMessage.file">
<fa-icon icon="file-alt" class="file-icon" [class.set-active-item-font-to-white]="dm._id == idSelected"></fa-icon>
+1
View File
@@ -382,6 +382,7 @@ hideRefreshButton(){
async getDirectMessages(event?){
this.chatService.getAllDirectMessages().subscribe(async (res:any)=>{
console.log(res.ims);
if(res != 200){
//console.log(res.ims);
@@ -40,11 +40,11 @@
<ion-content>
<ion-refresher name="refresher" slot="fixed" (ionRefresh)="doRefresh($event)">
<!-- <ion-refresher name="refresher" slot="fixed" (ionRefresh)="doRefresh($event)">
<ion-progress-bar type="indeterminate" *ngIf="showLoader"></ion-progress-bar>
<ion-refresher-content>
</ion-refresher-content>
</ion-refresher>
</ion-refresher> -->
<div (click)="handleClick()" class="messages overflow-y-auto" #scrollMe>
<div class="welcome-text">
@@ -41,11 +41,11 @@
<ion-content>
<ion-refresher name="refresher" slot="fixed" (ionRefresh)="doRefresh($event)">
<!-- <ion-refresher name="refresher" slot="fixed" (ionRefresh)="doRefresh($event)">
<ion-progress-bar type="indeterminate" *ngIf="showLoader"></ion-progress-bar>
<ion-refresher-content>
</ion-refresher-content>
</ion-refresher>
</ion-refresher> -->
<div (click)="handleClick()" class="messages" #scrollMe>
<div class="messages-list-item-wrapper container-width-100" *ngFor="let msg of chatMessageStore.message[roomId]; let last = last"
+3 -2
View File
@@ -401,6 +401,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
}
async openChatOptions(ev?: any) {
const roomId = this.roomId
console.log(this.members);
const popover = await this.popoverController.create({
@@ -421,11 +422,11 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
this.bookMeeting();
}
else if(res['data'] == 'take-picture'){
this.fileService.addCameraPictureToChat(this.roomId);
this.fileService.addCameraPictureToChat(roomId);
//this.loadPicture();
}
else if(res['data'] == 'add-picture'){
this.fileService.addPictureToChat(this.roomId);
this.fileService.addPictureToChat(roomId);
//this.loadPicture();
}
else if(res['data'] == 'add-document'){
+3 -1
View File
@@ -111,7 +111,7 @@ export class FileService {
}
}
addPictureToChat(roomId:string) {
addPictureToChat(roomId) {
const input = this.fileLoaderService.createInput({
accept: ['image/apng', 'image/jpeg', 'image/png']
})
@@ -141,6 +141,8 @@ export class FileService {
}
}
console.log(this.capturedImage)
this.chatService.sendMessage(body).subscribe(res=> {
loader.remove();
//console.log(res);
@@ -138,18 +138,18 @@
<ion-fab-button (click)="bookMeeting()" color="light">
<ion-icon name="calendar"></ion-icon>
</ion-fab-button>
<ion-fab-button (click)="addFileWebtrix()" color="light">
<ion-icon src="assets/icon/webtrix.svg"></ion-icon>
</ion-fab-button>
<ion-fab-button (click)="addFile()" color="light">
<ion-icon name="document"></ion-icon>
</ion-fab-button>
<ion-fab-button (click)="addImage()" color="light">
<ion-fab-button hidden (click)="addImage()" color="light">
<ion-icon name="image"></ion-icon>
</ion-fab-button>
<ion-fab-button class="hide-desktop" (click)="takePicture()" color="light">
<ion-fab-button hidden class="hide-desktop" (click)="takePicture()" color="light">
<ion-icon name="camera"></ion-icon>
</ion-fab-button>
<ion-fab-button (click)="addFileWebtrix()" color="light">
<ion-icon src="assets/icon/webtrix.svg"></ion-icon>
</ion-fab-button>
</ion-fab-list>
</ion-fab>
</div>
@@ -111,10 +111,7 @@
<ion-fab-button (click)="bookMeeting()" color="light">
<ion-icon name="calendar"></ion-icon>
</ion-fab-button>
<ion-fab-button (click)="addFileWebtrix()" color="light">
<ion-icon src="assets/icon/webtrix.svg"></ion-icon>
</ion-fab-button>
<ion-fab-button (click)="addFile()" color="light">
<ion-fab-button hidden (click)="addFile()" color="light">
<ion-icon name="document"></ion-icon>
</ion-fab-button>
<ion-fab-button (click)="addImage()" color="light">
@@ -123,6 +120,9 @@
<ion-fab-button class="hide-desktop" (click)="takePicture()" color="light">
<ion-icon name="camera"></ion-icon>
</ion-fab-button>
<ion-fab-button (click)="addFileWebtrix()" color="light">
<ion-icon src="assets/icon/webtrix.svg"></ion-icon>
</ion-fab-button>
</ion-fab-list>
</ion-fab>
@@ -380,10 +380,12 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
takePicture(){
this.fileService.addCameraPictureToChat(this.roomId);
const roomId = this.roomId
this.fileService.addCameraPictureToChat(roomId);
}
addImage(){
this.fileService.addPictureToChat(this.roomId);
const roomId = this.roomId
this.fileService.addPictureToChat(roomId);
}
addFile(){
this.fileService.addDocumentToChat(this.roomId);
@@ -6,9 +6,9 @@
</div>
<div class="buttons">
<button (click)="takePicture()" full class="btn-ok" shape="round" >Tirar Fotografia</button>
<button hidden (click)="notImplemented()" class="btn-ok" shape="round" >Digitalizar Documento</button>
<button (click)="addFile()" class="btn-ok" shape="round" >Anexar Documento</button>
<button (click)="anexarFoto()" full class="btn-ok" shape="round" >Anexar Fotografia</button>
<button (click)="addDocGestaoDocumental()" class="btn-ok" shape="round" >Anexar Documento (G.D.)</button>
<button (click)="addDocGestaoDocumental()" class="btn-ok" shape="round" >Gestão Documental</button>
<div class="solid"></div>
<button (click)="bookMeeting()" class="btn-ok" shape="round" >Novo Evento</button>
<button (click)="close()" full class="btn-cancel" shape="round" >Cancelar</button>
@@ -54,6 +54,15 @@ export class ChatOptionsPopoverPage implements OnInit {
}
}
addFile(){
if( window.innerWidth < 701){
this.popoverController.dismiss('add-document');
}
else{
this.modalController.dismiss('add-document');
}
}
anexarFoto(){
if( window.innerWidth < 701){
this.popoverController.dismiss('add-picture');