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
+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')
}