diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 4e9395928..552415fe7 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -9,6 +9,7 @@ import { Storage } from '@ionic/storage'; import { register } from 'swiper/element/bundle'; import { DomSanitizer } from '@angular/platform-browser'; import { ScreenOrientation } from "@ionic-native/screen-orientation/ngx"; +import { SessionStore } from './store/session.service'; const CUSTOM_DATE_FORMATS: NgxMatDateFormats = { parse: { dateInput: "YYYY-MMMM-DD HH:mm" @@ -31,6 +32,8 @@ register(); ] }) export class AppComponent { + tabIsActive = true + constructor( private platform: Platform, private statusBar: StatusBar, @@ -67,6 +70,27 @@ export class AppComponent { } } + + window.addEventListener('focus', (event) => { + if (!this.tabIsActive) { + this.tabIsActive = true + const data = SessionStore.getDataFromLocalStorage(); + + if (!data?.user?.Authorization && SessionStore?.user?.Authorization) { + window.location.reload(); + } + + if (window['all-process-gabinete']) { + window['all-process-gabinete']() + } + } + }); + + window.addEventListener('blur', (event) => { + this.tabIsActive = false + }); + + } /* requestPermission() { diff --git a/src/app/services/auth.service.ts b/src/app/services/auth.service.ts index ac939133f..19f3047a7 100644 --- a/src/app/services/auth.service.ts +++ b/src/app/services/auth.service.ts @@ -43,26 +43,6 @@ export class AuthService { private errorHandler: ErrorHandler, private platform: Platform,) { - - window.addEventListener('focus', (event) => { - if (!this.tabIsActive) { - this.tabIsActive = true - const data = SessionStore.getDataFromLocalStorage(); - - if (!data?.user?.Authorization && SessionStore?.user?.Authorization) { - window.location.reload(); - } - - if (window['all-process-gabinete']) { - window['all-process-gabinete']() - } - } - }); - - window.addEventListener('blur', (event) => { - this.tabIsActive = false - }); - } async login(user: UserForm, { saveSession = true }): Promise { diff --git a/version/git-version.ts b/version/git-version.ts index 3bde737a5..22f25980c 100644 --- a/version/git-version.ts +++ b/version/git-version.ts @@ -1,11 +1,11 @@ export let versionData = { - "shortSHA": "5c18f281b", - "SHA": "5c18f281bc053ecb7db47fbeb4355aa40634dcac", + "shortSHA": "b2d19879a", + "SHA": "b2d19879a713ab018e36ba2a1385ff9c28364469", "branch": "feature/login-v2", "lastCommitAuthor": "'Peter Maquiran'", - "lastCommitTime": "'Wed Nov 6 10:38:58 2024 +0100'", - "lastCommitMessage": "change login v1 to v2", - "lastCommitNumber": "6128", - "changeStatus": "On branch feature/login-v2\nChanges to be committed:\n (use \"git restore --staged ...\" to unstage)\n\tmodified: src/app/shared/gabinete-digital/generic/task-details/task-details.page.ts\n\tmodified: version/git-version.ts", + "lastCommitTime": "'Wed Nov 6 10:43:19 2024 +0100'", + "lastCommitMessage": "fix gabinete error text", + "lastCommitNumber": "6129", + "changeStatus": "On branch feature/login-v2\nChanges to be committed:\n (use \"git restore --staged ...\" to unstage)\n\tmodified: src/app/app.component.ts\n\tmodified: src/app/services/auth.service.ts", "changeAuthor": "peter.maquiran" } \ No newline at end of file