This commit is contained in:
tiago.kayaya
2021-11-03 15:35:01 +01:00
parent adc80aaff3
commit 3f6b053660
11 changed files with 120 additions and 76 deletions
+2 -2
View File
@@ -96,7 +96,7 @@ ion-content{
margin-top: 10px;
}
.item-title{
width: calc(100% - 80px);
width: calc(100% - 90px);
float: left;
font-size: 15px;
color: var(--title-text-color);
@@ -105,7 +105,7 @@ ion-content{
color: #fff;
}
.item-date{
width: 80px;
width: 90px;
float: right;
font-size: 13px;
color: #797979;
+21 -3
View File
@@ -29,6 +29,7 @@ import { environment } from 'src/environments/environment';
import { NotificationsService } from 'src/app/services/notifications.service';
import { TimeService } from 'src/app/services/functions/time.service';
import { ThemeService } from 'src/app/services/theme.service'
import { DataService } from 'src/app/services/data.service';
@Component({
@@ -115,7 +116,9 @@ export class ChatPage implements OnInit {
private resolver: ComponentFactoryResolver,
private route: Router,
private timeService: TimeService,
public ThemeService: ThemeService
public ThemeService: ThemeService,
private dataService:DataService,
private router: Router,
){
this.loggedUserChat = authService.ValidatedUserChat['data'];
this.headers = new HttpHeaders();
@@ -150,6 +153,21 @@ export class ChatPage implements OnInit {
console.log(t);
this.setStatus('away');
if(this.dataService.get("newGroup")){
this.openNewGroupPage();
}
this.router.events.forEach((event) => {
if (event instanceof NavigationStart && event.url.startsWith('/home/chat')) {
if (window.location.pathname.split('/').length >= 4 && window.location.pathname.startsWith('/home/chat')) {
alert('OIII')
} else {
if(this.dataService.get("newGroup")){
this.openNewGroupPage();
}
}
}
});
}
ngOnDestroy(){
@@ -397,7 +415,7 @@ hideRefreshButton(){
//console.log('TIMER');
//Check if modal is opened
if(this.segment == "Contactos" && this.showMessages != true){
await new Promise(resolve => setTimeout(resolve, 2000));
await new Promise(resolve => setTimeout(resolve, 1000));
await this.getDirectMessages();
//console.log('Timer contactos list running')
}
@@ -453,7 +471,7 @@ hideRefreshButton(){
else {
//Check if modal is opened
if(this.segment == "Grupos" && this.showGroupMessages != true){
await new Promise(resolve => setTimeout(resolve, 2000));
await new Promise(resolve => setTimeout(resolve, 1000));
await this.getGroups();
//console.log('Timer groups list running')
}
@@ -126,6 +126,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
ngAfterViewInit() {
this.scrollChangeCallback = () => this.onContentScrolled(event);
window.addEventListener('scroll', this.scrollChangeCallback, true);
this.roomCountDownDate = this.timeService.countDownDate(this.room.customFields.countDownDate, this.room._id);
}
handlePress(id?:string){
@@ -184,7 +185,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
this.room = room['room'];
this.roomName = this.room.name.split('-').join(' ');
if(this.room.customFields.countDownDate){
this.roomCountDownDate = this.timeService.countDownDate(this.room.customFields.countDownDate, this.room._id);
this.roomCountDownDate = this.timeService.countDownDateTimer(this.room.customFields.countDownDate, this.room._id);
}
this.getGroupContacts(this.room);
this.loadGroupMessages(this.room);
@@ -260,7 +261,8 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
return this.timeService.showDateDuration(start);
}
countDownDate(date:any, roomId:string){
return this.timeService.countDownDate(date, roomId);
this.roomCountDownDate = this.timeService.countDownDate(date, roomId);
return this.timeService.countDownDateTimer(date, roomId);
}
addZero(i) {
@@ -32,7 +32,7 @@
</div>
<div *ngIf="showDuration" class="container-div">
<div class="ion-item-class-2">
<div class="ion-item-class-2 width-100">
<div class="ion-icon-class">
<ion-icon slot="start" src="assets/images/icons-duration.svg"></ion-icon>
</div>
@@ -61,7 +61,7 @@ ion-content{
.middle{
padding: 0!important;
float: left;
width: 221px;
width:fit-content;
margin: 2.5px 0 0 5px;
}
.btn-criar{
@@ -115,7 +115,6 @@ ion-content{
.item-container-no-border{
display: flex;
width: 360px;
margin: 25px auto;
border-radius: 5px;
align-items: center;
@@ -133,8 +132,8 @@ ion-content{
overflow: auto;
.ion-item-class-2{
width: 360px;
margin: 0px auto;
overflow: auto;
.ion-icon-class{
width: 45px;
@@ -145,7 +144,7 @@ ion-content{
}
}
.ion-input-class{
width: 315px;
width: calc(100% - 45px) !important;
height: 45px;
border: 1px solid #ebebeb;
border-radius: 5px;
@@ -52,6 +52,7 @@ export class NewGroupPage implements OnInit {
createGroup(){
let name = this.groupName.split(' ').join('-');
name = name.normalize("NFD").replace(/[\u0300-\u036f]/g, "");
let body = { "name":name, }
this.chatService.addGroup(body).subscribe(res=>{
console.log('group created');