diff --git a/src/app/app.component.ts b/src/app/app.component.ts index fadb07747..14ab0d183 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -12,7 +12,8 @@ import { SqliteService } from 'src/app/services/sqlite.service'; import { BackgroundService } from 'src/app/services/background.service'; import { ScreenOrientation } from '@ionic-native/screen-orientation/ngx'; import { StorageService } from 'src/app/services/storage.service'; -import { MessageModel } from './models/beast-orm' +import { MessageModel } from './models/beast-orm'; +import { InativityService } from "src/app/services/inativity.service"; const CUSTOM_DATE_FORMATS: NgxMatDateFormats = { parse: { @@ -43,7 +44,8 @@ export class AppComponent { private screenOrientation: ScreenOrientation, private sqliteservice: SqliteService, private backgroundservice: BackgroundService, - private storageservice: StorageService + private storageservice: StorageService, + private InativityService: InativityService ) { // this.createCacheFolder() this.initializeApp(); diff --git a/src/app/home/home.page.ts b/src/app/home/home.page.ts index 732fc50af..6e0f74a4d 100644 --- a/src/app/home/home.page.ts +++ b/src/app/home/home.page.ts @@ -118,7 +118,12 @@ export class HomePage implements OnInit { const pathname = window.location.pathname SessionStore.setUrlBeforeInactivity(pathname) - this.router.navigate(['/inactivity']); + + if (this.platform.is('mobileweb')) { + this.router.navigate(['/inactivity']); + }else{ + this.router.navigate(['/']); + } } } diff --git a/src/app/services/inativity.service.ts b/src/app/services/inativity.service.ts index 1ea52ceca..e90571ed8 100644 --- a/src/app/services/inativity.service.ts +++ b/src/app/services/inativity.service.ts @@ -11,7 +11,7 @@ export class InativityService { private router: Router, ) { - var t; + var time; window.onload = resetTimer; window.onmousemove = resetTimer; window.onmousedown = resetTimer; // catches touchscreen presses as well @@ -28,8 +28,9 @@ export class InativityService { } function resetTimer() { - clearTimeout(t); - t = setTimeout(userIsNotActive, 60000 * 5); // time is in milliseconds + clearTimeout(time); + // t = setTimeout(userIsNotActive, 60000 * 5); // time is in milliseconds + time = setTimeout(userIsNotActive, 3000); } } }