time out
This commit is contained in:
@@ -20,3 +20,5 @@ ionic generate page jobactive
|
||||
ionic generate component taskactivities
|
||||
|
||||
npm install angularx-qrcode@14.0.0 --save
|
||||
|
||||
npm install bn-ng-idle
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
"@capacitor/status-bar": "^5.0.0",
|
||||
"@ionic/angular": "^6.1.9",
|
||||
"angularx-qrcode": "^14.0.0",
|
||||
"bn-ng-idle": "^2.0.5",
|
||||
"onesignal-cordova-plugin": "^5.0.0-beta-02",
|
||||
"rxjs": "~6.6.0",
|
||||
"sha.js": "^2.4.11",
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { BnNgIdleService } from 'bn-ng-idle';
|
||||
import {SessionDataProviderService} from "./store/session-data-provider.service";
|
||||
import {Router} from "@angular/router"; // import it to your component
|
||||
|
||||
@Component({
|
||||
selector: 'app-root',
|
||||
@@ -6,8 +9,16 @@ import { Component } from '@angular/core';
|
||||
styleUrls: ['app.component.scss'],
|
||||
})
|
||||
export class AppComponent {
|
||||
constructor() {
|
||||
constructor(private bnIdle: BnNgIdleService,private sessionDataProviderService : SessionDataProviderService, public router: Router) {
|
||||
// this.OneSignalInit();
|
||||
this.bnIdle.startWatching(300).subscribe((res) => {
|
||||
if(res) {
|
||||
console.log("session expired");
|
||||
// alert('LOG OUT NOW');
|
||||
this.sessionDataProviderService.DestroySessionOnLogout();
|
||||
this.router.navigate(['login']);
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// Call this function when your app starts
|
||||
|
||||
@@ -8,12 +8,13 @@ import { AppRoutingModule } from './app-routing.module';
|
||||
import { AppComponent } from './app.component';
|
||||
|
||||
import { HttpClientModule } from '@angular/common/http';
|
||||
|
||||
import { BnNgIdleService } from 'bn-ng-idle'; // import bn-ng-idle service
|
||||
|
||||
@NgModule({
|
||||
declarations: [AppComponent],
|
||||
imports: [BrowserModule, IonicModule.forRoot(), AppRoutingModule, HttpClientModule],
|
||||
providers: [{ provide: RouteReuseStrategy, useClass: IonicRouteStrategy }],
|
||||
imports: [BrowserModule, IonicModule.forRoot(), AppRoutingModule, HttpClientModule
|
||||
],
|
||||
providers: [{ provide: RouteReuseStrategy, useClass: IonicRouteStrategy },BnNgIdleService],
|
||||
bootstrap: [AppComponent],
|
||||
})
|
||||
export class AppModule { }
|
||||
|
||||
@@ -2,6 +2,7 @@ import { Router } from '@angular/router';
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { WrenchService } from 'src/app/services/wrench.service';
|
||||
import {SessionDataProviderService} from "../../store/session-data-provider.service";
|
||||
import {NavController} from "@ionic/angular";
|
||||
|
||||
@Component({
|
||||
selector: 'app-transaction',
|
||||
@@ -12,6 +13,7 @@ export class TransactionPage implements OnInit {
|
||||
|
||||
constructor(
|
||||
private router: Router,
|
||||
private navctr: NavController,
|
||||
public sessionDataProviderService: SessionDataProviderService,
|
||||
private wrenchService: WrenchService
|
||||
) { }
|
||||
@@ -21,6 +23,10 @@ export class TransactionPage implements OnInit {
|
||||
// this.getPaymentHxData();
|
||||
}
|
||||
|
||||
onBack() {
|
||||
this.navctr.back();
|
||||
}
|
||||
|
||||
ionViewDidEnter(){
|
||||
this.getWalletData();
|
||||
this.getPaymentHxData();
|
||||
|
||||
Reference in New Issue
Block a user