mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 13:02:56 +00:00
improve
This commit is contained in:
@@ -128,7 +128,7 @@
|
||||
<ion-label>{{group.name.split('-').join(' ')}}</ion-label>
|
||||
</div>
|
||||
<div class="item-date" [class.item-date-active]="group.id ==idSelected" *ngIf="group.lastMessage && !group.customFields.countDownDate">{{group.duration}}</div>
|
||||
<div class="item-date" [class.item-date-active]="group.id ==idSelected" *ngIf="group.customFields.countDownDate">{{countDownDate(group.customFields.countDownDate, group.id)}}</div>
|
||||
<div class="item-date" [class.item-date-active]="group.id ==idSelected" *ngIf="group.customFields.countDownDate">{{group.countDownTime}}</div>
|
||||
</div>
|
||||
<div *ngIf="group.lastMessage" class="item-description d-flex align-items-center" [class.item-description-active]="group.id ==idSelected">
|
||||
<div class="item-message" *ngIf="group.otherUserType == false">{{group.lastMessage.u.name}}: {{group.lastMessage.msg}} </div>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http';
|
||||
import { HttpClient, HttpErrorResponse, HttpHeaders, HttpParams } from '@angular/common/http';
|
||||
import {
|
||||
Component,
|
||||
OnInit,
|
||||
@@ -44,7 +44,6 @@ export class ChatPage implements OnInit {
|
||||
X_Auth_Token: any;
|
||||
|
||||
loggedUser: any;
|
||||
/* Set segment variable */
|
||||
segment: string;
|
||||
allGroups: any[];
|
||||
privateGroups: any[];
|
||||
@@ -90,8 +89,6 @@ export class ChatPage implements OnInit {
|
||||
"support": ["1"]
|
||||
};
|
||||
|
||||
|
||||
/* Fim websockets variables*/
|
||||
loggedUserChat: any;
|
||||
hideRefreshBtn = true;
|
||||
|
||||
@@ -128,11 +125,22 @@ export class ChatPage implements OnInit {
|
||||
|
||||
this.showLoader = true;
|
||||
|
||||
//this.load()
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
/* let data = {
|
||||
status: "success",
|
||||
data: {
|
||||
userId: "CqYSKR5hrAumZihs7",
|
||||
authToken: "bvh5BH98Av5ShMnEW94Cwm1Hf-yHEHbl121ijq5Odc_sdvs"
|
||||
}
|
||||
}
|
||||
SessionStore.user.ChatData = data
|
||||
SessionStore.save() */
|
||||
console.log(SessionStore.user.ChatData.data.authToken)
|
||||
this.chatService.refreshtoken();
|
||||
|
||||
this.segment = "Contactos";
|
||||
|
||||
this.authService.userData$.subscribe((res: any) => {
|
||||
@@ -497,16 +505,11 @@ export class ChatPage implements OnInit {
|
||||
}
|
||||
|
||||
async getChatMembers() {
|
||||
//return await this.chatService.getMembers(roomId).toPromise();
|
||||
|
||||
this.chatService.getAllUsers().subscribe(res => {
|
||||
//
|
||||
this.transformDataUserList(res['users'])
|
||||
|
||||
/* if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||
this.dmUsers = res['users'].filter(data => data.username != this.loggedUserChat.me.username);
|
||||
//
|
||||
}*/
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
@@ -563,23 +566,6 @@ export class ChatPage implements OnInit {
|
||||
|
||||
})
|
||||
|
||||
/* this.sqlservice.getAllChatUsers().then((userslist: any) => {
|
||||
|
||||
let chatusersArray = [];
|
||||
userslist.forEach(element => {
|
||||
|
||||
let userListDB = {
|
||||
_id: element.Id,
|
||||
name: element.Name,
|
||||
username: element.Username
|
||||
}
|
||||
|
||||
chatusersArray.push(userListDB);
|
||||
});
|
||||
|
||||
this.dmUsers = chatusersArray.filter(data => data.username != this.loggedUserChat.me.username);
|
||||
|
||||
}) */
|
||||
}
|
||||
|
||||
}
|
||||
@@ -635,16 +621,7 @@ export class ChatPage implements OnInit {
|
||||
|
||||
this.privateGroups = res.groups;
|
||||
|
||||
/* this.result = this.chatService.getAllUserChannels().subscribe((res:any)=>{
|
||||
this.publicGroups = res.channels; */
|
||||
//let all = this.privateGroups.concat(this.publicGroups);
|
||||
/* this.allGroups = this.privateGroups.sort((a, b) => {
|
||||
var dateA = new Date(a._updatedAt).getTime();
|
||||
var dateB = new Date(b._updatedAt).getTime();
|
||||
return dateB - dateA;
|
||||
}); */
|
||||
//
|
||||
/* }); */
|
||||
|
||||
if (this.route.url != "/home/chat") {
|
||||
//
|
||||
}
|
||||
@@ -735,10 +712,5 @@ export class ChatPage implements OnInit {
|
||||
modal.onDidDismiss();
|
||||
}
|
||||
|
||||
// this.crop.crop('path/to/image.jpg', {quality: 75})
|
||||
// .then(
|
||||
// newImage =>
|
||||
// error => console.error('Error cropping image', error)
|
||||
// );
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { HttpErrorResponse } from '@angular/common/http';
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ModalController, NavParams, PickerController } from '@ionic/angular';
|
||||
import { ChatService } from 'src/app/services/chat.service';
|
||||
@@ -28,6 +29,7 @@ export class EditGroupPage implements OnInit {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.chatService.refreshtoken();
|
||||
this.getRoomInfo();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { HttpClient, HttpHeaders } from '@angular/common/http';
|
||||
import { HttpClient, HttpErrorResponse, HttpHeaders } from '@angular/common/http';
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ModalController, NavParams } from '@ionic/angular';
|
||||
import * as _ from 'lodash';
|
||||
@@ -56,6 +56,7 @@ export class GroupContactsPage implements OnInit {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.chatService.refreshtoken();
|
||||
this.loadUsers();
|
||||
this.getMembers();
|
||||
|
||||
|
||||
@@ -31,6 +31,7 @@ import { MessageService } from 'src/app/services/chat/message.service';
|
||||
import { File } from '@awesome-cordova-plugins/file/ngx';
|
||||
import { FileOpener } from '@awesome-cordova-plugins/file-opener/ngx';
|
||||
import { SessionStore } from 'src/app/store/session.service';
|
||||
import { HttpErrorResponse } from '@angular/common/http';
|
||||
|
||||
@Component({
|
||||
selector: 'app-group-messages',
|
||||
@@ -132,6 +133,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.chatService.refreshtoken();
|
||||
|
||||
this.loggedUser = this.loggedUserChat;
|
||||
this.getRoomInfo();
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { HttpClient, HttpHeaders } from '@angular/common/http';
|
||||
import { HttpClient, HttpErrorResponse, HttpHeaders } from '@angular/common/http';
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ModalController } from '@ionic/angular';
|
||||
import { AuthService } from 'src/app/services/auth.service';
|
||||
@@ -43,6 +43,7 @@ export class ContactsPage implements OnInit {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.chatService.refreshtoken();
|
||||
this.loadUsers();
|
||||
|
||||
}
|
||||
|
||||
@@ -36,6 +36,7 @@ import { FileToBase64Service } from 'src/app/services/file/file-to-base64.servic
|
||||
import { Camera, CameraResultType, CameraSource } from '@capacitor/camera';
|
||||
import { DomSanitizer } from '@angular/platform-browser';
|
||||
import { SessionStore } from 'src/app/store/session.service';
|
||||
import { HttpErrorResponse } from '@angular/common/http';
|
||||
|
||||
|
||||
const IMAGE_DIR = 'stored-images';
|
||||
@@ -156,6 +157,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.chatService.refreshtoken();
|
||||
this.wsChatMethodsService.getUserOfRoom(this.roomId).then((value) => {
|
||||
|
||||
})
|
||||
|
||||
@@ -43,6 +43,7 @@ export class NewGroupPage implements OnInit {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.chatService.refreshtoken();
|
||||
console.log(this.documents)
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user