From 791a0b2fb722592fc6f0169c0d736419c84e6364 Mon Sep 17 00:00:00 2001 From: Lorito Tiago <58330997+LoritoTiago@users.noreply.github.com> Date: Thu, 19 Oct 2023 15:58:55 +0100 Subject: [PATCH] change variable --- ios/App/App.xcodeproj/project.pbxproj | 4 ++-- src/app/pages/chat/chat.page.ts | 2 +- src/app/services/route.service.ts | 20 +++++++++++--------- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/ios/App/App.xcodeproj/project.pbxproj b/ios/App/App.xcodeproj/project.pbxproj index 1e860d85a..2b364ce34 100644 --- a/ios/App/App.xcodeproj/project.pbxproj +++ b/ios/App/App.xcodeproj/project.pbxproj @@ -390,7 +390,7 @@ CODE_SIGN_ENTITLEMENTS = App/App.entitlements; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = 61; + CURRENT_PROJECT_VERSION = 63; DEVELOPMENT_TEAM = ""; "DEVELOPMENT_TEAM[sdk=iphoneos*]" = 94BRNM2LSS; INFOPLIST_FILE = App/Info.plist; @@ -419,7 +419,7 @@ CODE_SIGN_ENTITLEMENTS = App/App.entitlements; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = 61; + CURRENT_PROJECT_VERSION = 63; DEVELOPMENT_TEAM = ""; "DEVELOPMENT_TEAM[sdk=iphoneos*]" = 94BRNM2LSS; INFOPLIST_FILE = App/Info.plist; diff --git a/src/app/pages/chat/chat.page.ts b/src/app/pages/chat/chat.page.ts index 5008e5e01..15b27f49d 100644 --- a/src/app/pages/chat/chat.page.ts +++ b/src/app/pages/chat/chat.page.ts @@ -200,7 +200,7 @@ export class ChatPage implements OnInit { if (this.firstEnter) { this.firstEnter = false - let delay = this.RouteService.history.find((item) => { + let delay = this.RouteService.liveHistory.find((item) => { return ['/home/publications', '/home/agenda', '/home/gabinete', '/home/events'].filter(x => { return item.includes(x) }).length >= 1 diff --git a/src/app/services/route.service.ts b/src/app/services/route.service.ts index 7b4a2e24b..20a56a1fd 100644 --- a/src/app/services/route.service.ts +++ b/src/app/services/route.service.ts @@ -9,6 +9,7 @@ import { Location } from '@angular/common' export class RouteService { history: any = []; + liveHistory = []; constructor( private router: Router, @@ -23,8 +24,9 @@ export class RouteService { const lastRoute = this.history.slice(-1) - if(event.url != lastRoute) { + if (event.url != lastRoute) { this.history.push(event.url) + this.liveHistory.push(event.url) this.reduceHistory() } @@ -37,16 +39,16 @@ export class RouteService { /** * @param url [string] incase no history to go back */ - goBack(url = null) { - if(this.history.length >= 2) { - + goBack(url = null) { + if (this.history.length >= 2) { + this.history.pop(); const url = this.history.pop(); this.goTo(url) - } else if(url) { + } else if (url) { this.goTo(url) } @@ -58,13 +60,13 @@ export class RouteService { queryParams: this.queryParams(url) } - const urlObject = new URL('http://localhost:8100'+url); + const urlObject = new URL('http://localhost:8100' + url); this.router.navigate([urlObject.pathname], navigationExtras); } reduceHistory() { - if(this.history.length >= 15) { + if (this.history.length >= 15) { this.history = this.history.slice(5, this.history.length) } this.LocalstoreService.set('history', this.history) @@ -73,7 +75,7 @@ export class RouteService { queryParams(url) { - const urlObject = new URL('http://localhost:8100'+url); + const urlObject = new URL('http://localhost:8100' + url); const paramsString = urlObject.search; let searchParams: any = new URLSearchParams(paramsString); @@ -83,7 +85,7 @@ export class RouteService { params[key] = value } - + return params }