mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 21:06:06 +00:00
improve
This commit is contained in:
@@ -16,7 +16,7 @@ import { MessagesPage } from './messages/messages.page';
|
||||
import { NewGroupPage } from './new-group/new-group.page';
|
||||
import { EditGroupPage } from 'src/app/shared/chat/edit-group/edit-group.page';
|
||||
import { Subject } from "rxjs/Rx";
|
||||
import { NavigationStart, Router, NavigationEnd } from '@angular/router';
|
||||
import { NavigationStart, Router, NavigationEnd, ActivatedRoute } from '@angular/router';
|
||||
import { EventPerson } from 'src/app/models/eventperson.model';
|
||||
import { removeDuplicate } from 'src/plugin/removeDuplicate.js'
|
||||
import { environment } from 'src/environments/environment';
|
||||
@@ -113,6 +113,7 @@ export class ChatPage implements OnInit {
|
||||
private platform: Platform,
|
||||
private storageservice: StorageService,
|
||||
public ChatSystemService: ChatSystemService,
|
||||
private activatedRoute: ActivatedRoute,
|
||||
) {
|
||||
|
||||
this.headers = new HttpHeaders();
|
||||
@@ -141,14 +142,39 @@ export class ChatPage implements OnInit {
|
||||
|
||||
|
||||
this.router.events.forEach((event) => {
|
||||
|
||||
if (event instanceof NavigationEnd && event.url == '/home/chat' ||
|
||||
event instanceof NavigationEnd && event.url == "/home/chat?gbCreateGroup=true") {
|
||||
this.checkCreateGroup();
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
this.router.events.forEach((event) => {
|
||||
if (event instanceof NavigationEnd && event.url.startsWith('/home/chat')) {
|
||||
this.routeCheck()
|
||||
}
|
||||
});
|
||||
|
||||
this.routeCheck()
|
||||
}
|
||||
|
||||
routeCheck() {
|
||||
|
||||
const urlParams = new URLSearchParams(window.location.search);
|
||||
const roomId = urlParams.get('roomId');
|
||||
|
||||
if(roomId) {
|
||||
const room = this.ChatSystemService.getRoomById(roomId);
|
||||
|
||||
if(room.isGroup) {
|
||||
this.segment = 'Grupos'
|
||||
this.openGroupMessagesPage(roomId)
|
||||
} else {
|
||||
this.segment = 'Contactos'
|
||||
this.openMessagesPage(roomId)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
checkCreateGroup() {
|
||||
|
||||
@@ -330,8 +330,6 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
}
|
||||
|
||||
async goToEvent(event: any) {
|
||||
|
||||
// console.log(event)
|
||||
|
||||
let classs;
|
||||
if (window.innerWidth < 701) {
|
||||
|
||||
Reference in New Issue
Block a user