Merge pull request #8070 from cmgustavo/feat/resume-event-01

Update wallets on resume event (only mobile)
This commit is contained in:
Gabriel Edgardo Bazán 2018-02-19 14:37:09 -03:00 committed by GitHub
commit 1cf98783b0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 14 additions and 6 deletions

View File

@ -1,7 +1,7 @@
import { Component } from '@angular/core'; import { Component } from '@angular/core';
import { SplashScreen } from '@ionic-native/splash-screen'; import { SplashScreen } from '@ionic-native/splash-screen';
import { StatusBar } from '@ionic-native/status-bar'; import { StatusBar } from '@ionic-native/status-bar';
import { ModalController, Platform } from 'ionic-angular'; import { Events, ModalController, Platform } from 'ionic-angular';
import { Subscription } from 'rxjs'; import { Subscription } from 'rxjs';
//providers //providers
@ -38,6 +38,7 @@ export class CopayApp {
private platform: Platform, private platform: Platform,
private statusBar: StatusBar, private statusBar: StatusBar,
private splashScreen: SplashScreen, private splashScreen: SplashScreen,
private events: Events,
private logger: Logger, private logger: Logger,
private app: AppProvider, private app: AppProvider,
private profile: ProfileProvider, private profile: ProfileProvider,
@ -70,11 +71,18 @@ export class CopayApp {
this.statusBar.styleLightContent(); this.statusBar.styleLightContent();
this.splashScreen.hide(); this.splashScreen.hide();
}
//Check PIN or Fingerprint // Subscribe Resume
this.onResumeSubscription = this.platform.resume.subscribe(() => { this.onResumeSubscription = this.platform.resume.subscribe(() => {
this.openLockModal();
}); // Update Wallet Status
this.events.publish('status:updated');
// Check PIN or Fingerprint
this.openLockModal();
});
}
this.openLockModal(); this.openLockModal();
// Check Profile // Check Profile
this.profile.loadAndBindProfile().then((profile: any) => { this.profile.loadAndBindProfile().then((profile: any) => {