diff --git a/src/app/modals/profile/profile.page.html b/src/app/modals/profile/profile.page.html index aff515ede..fd01e2027 100644 --- a/src/app/modals/profile/profile.page.html +++ b/src/app/modals/profile/profile.page.html @@ -1,7 +1,7 @@
-
+
diff --git a/src/app/modals/profile/profile.page.ts b/src/app/modals/profile/profile.page.ts index b4d94dc95..6c3692569 100644 --- a/src/app/modals/profile/profile.page.ts +++ b/src/app/modals/profile/profile.page.ts @@ -31,6 +31,8 @@ export class ProfilePage implements OnInit { md: "100000011"; date: "60:20"; location: "Gabinete"; + isProfileOpen = false + hideImage = false constructor(private modalController: ModalController, private authService: AuthService, @@ -43,11 +45,16 @@ export class ProfilePage implements OnInit { private platform: Platform, private eventtrigger: EventTrigger, public ThemeService: ThemeService, - private sortService: SortService, ) { this.loggeduser = authService.ValidatedUser; + router.events.subscribe((val) => { + this.isProfileOpen = false + }); + setTimeout(()=>{ + this.hideImage = true + }, 2000) } ngOnInit() { @@ -58,15 +65,6 @@ export class ProfilePage implements OnInit { this.getNotificationData(); } - /* this.notificationsService.registerCallback( - 'any', - () => { - setTimeout(()=>{ - this.getNotificationData(); - }, 100) - } - ) */ - } @@ -204,14 +202,7 @@ export class ProfilePage implements OnInit { } logout() { - this.authService.logout() - - /* SessionStore.setInativity(false) - SessionStore.setUrlBeforeInactivity(this.router.url) - setTimeout(() => { - this.router.navigateByUrl('/', { replaceUrl: true }); - }, 100) */ - + this.authService.logout(); } async editProfile() { @@ -240,15 +231,22 @@ export class ProfilePage implements OnInit { } - const modal = await this.modalController.create({ - enterAnimation, - leaveAnimation, - component: EditProfilePage, - cssClass: 'model profile-modal', - componentProps: { - } - }); - return await modal.present(); + if(this.isProfileOpen == false) { + this.isProfileOpen = true; + + const modal = await this.modalController.create({ + component: ProfilePage, + cssClass: 'model profile-modal search-submodal', + componentProps: { + } + }); + await modal.present(); + + modal.onDidDismiss().then(() => { + this.isProfileOpen = false; + }) + + } } } diff --git a/src/app/services/chat/chat-system.service.ts b/src/app/services/chat/chat-system.service.ts index 61c16a9e4..6d9bdd4cd 100644 --- a/src/app/services/chat/chat-system.service.ts +++ b/src/app/services/chat/chat-system.service.ts @@ -290,6 +290,7 @@ export class ChatSystemService { * @description subscribe all room */ subscribeToRoom() { + console.log("=====>>subscribeToRoom<<====="); for (const id in this.dm) { this.defaultSubtribe(id) diff --git a/src/app/services/chat/message.service.ts b/src/app/services/chat/message.service.ts index d52b15cf6..299f98e87 100644 --- a/src/app/services/chat/message.service.ts +++ b/src/app/services/chat/message.service.ts @@ -200,7 +200,7 @@ export class MessageService { } if(this.NetworkServiceService.getCurrentNetworkStatus() == ConnectionStatus.Online) { - console.log('online send') + // console.log('online send') this.RochetChatConnectorService.send(params).then( (ChatMessage: any) => { console.log('response') @@ -212,7 +212,7 @@ export class MessageService { ) } else { - console.log("reconnect") + // console.log("reconnect") this.RochetChatConnectorService.registerCallback({ type: 'reConnect', funx: async ()=> { diff --git a/src/app/services/chat/rochet-chat-connector.service.ts b/src/app/services/chat/rochet-chat-connector.service.ts index fe10bd718..73790cc42 100644 --- a/src/app/services/chat/rochet-chat-connector.service.ts +++ b/src/app/services/chat/rochet-chat-connector.service.ts @@ -693,7 +693,7 @@ export class RochetChatConnectorService { onopen: async ()=> { this.ws.connected = true - // console.log("Open connection =====================================================") + console.log("Open connection =====================================================") setTimeout(()=>{ diff --git a/src/app/shared/header/header.page.ts b/src/app/shared/header/header.page.ts index 566b0a59c..263ed7810 100644 --- a/src/app/shared/header/header.page.ts +++ b/src/app/shared/header/header.page.ts @@ -33,6 +33,7 @@ export class HeaderPage implements OnInit { production = environment.production environment = environment + isProfileOpen = false constructor( private router: Router, @@ -49,42 +50,24 @@ export class HeaderPage implements OnInit { this.loggeduser = SessionStore.user; router.events.subscribe((val) => { this.showSearch = false; - //this.modalController.dismiss(); + this.isProfileOpen = false }); + + + + } - ngOnInit() { + async ngOnInit() { this.hideSearch(); - this.update() - /* this.notificationLengthData(); - this.eventrigger.getObservable().subscribe(async (data) => { - if (data.notification === "delete" || "recive") { - await this.notificationLengthData(); - - - } - - }) */ + this.update(); + } update() { - /* setInterval(() => { - this.notificationLengthData(); - }, 5000) */ } - /* UpdateNotificationCount() { - this.notificationsService.registerCallback( - 'any', - () => { - setTimeout(()=>{ - this.notificationLengthData(); - }, 100) - } - ) - } */ - async notificationLengthData() { await this.storageservice.get("Notifications").then((value) => { @@ -189,19 +172,26 @@ export class HeaderPage implements OnInit { return enterAnimation(baseEl).direction('reverse'); } - const modal = await this.modalController.create({ - enterAnimation, - leaveAnimation, - component: ProfilePage, - cssClass: 'model profile-modal search-submodal', - componentProps: { - } - }); - await modal.present(); + + if(this.isProfileOpen == false) { + + this.isProfileOpen = true; + + const modal = await this.modalController.create({ + component: ProfilePage, + cssClass: 'model profile-modal search-submodal', + componentProps: { + } + }); + await modal.present(); + + modal.onDidDismiss().then(() => { + this.isProfileOpen = false; + this.notificationLengthData() + }) + + } - modal.onDidDismiss().then(() => { - this.notificationLengthData() - }) }