|
@@ -21,7 +21,7 @@ import { UpdateService } from '../services/update.service';
|
|
|
})
|
|
|
export class AppComponent implements OnInit {
|
|
|
title = 'live-app';
|
|
|
- leaveTime:number = new Date().getTime(); //用户离开应用时间
|
|
|
+ leaveTime: number = new Date().getTime(); //用户离开应用时间
|
|
|
@HostListener('document:visibilitychange', ['$event'])
|
|
|
onvisibilitychange(event) {
|
|
|
let isExits = event.target.visibilityState;
|
|
@@ -29,8 +29,13 @@ export class AppComponent implements OnInit {
|
|
|
let time = new Date().getTime() - this.leaveTime;
|
|
|
console.log('visible', time);
|
|
|
if (Parse.User.current()?.id && time > 1000 * 60 * 5) {
|
|
|
+ if(this.router.url.indexOf('/tabs/anthirhome') !== 0 && this.router.url.indexOf('/tabs/home') !== 0){
|
|
|
+ this.router.navigate(['/tabs/home'],{ replaceUrl: true });
|
|
|
+ }
|
|
|
+ setTimeout(() => {
|
|
|
+ window.location.reload();
|
|
|
+ }, 10);
|
|
|
// this.connectTask.init();
|
|
|
- window.location.reload();
|
|
|
}
|
|
|
// console.log('进入该页面');
|
|
|
} else {
|
|
@@ -41,9 +46,9 @@ export class AppComponent implements OnInit {
|
|
|
constructor(
|
|
|
private router: Router,
|
|
|
private updateServ: UpdateService,
|
|
|
+ // private connectTask: ConnectTaskService,
|
|
|
private backgroundColorService: BackgroundColorService
|
|
|
- ) // private connectTask: ConnectTaskService,
|
|
|
- {
|
|
|
+ ) {
|
|
|
this.initParseService();
|
|
|
this.initStatusBar();
|
|
|
this.updateServ.updateVersion();
|