diff --git a/src/lib/ApplicationState.js b/src/lib/ApplicationState.js index 8ae5c2b2..809255be 100644 --- a/src/lib/ApplicationState.js +++ b/src/lib/ApplicationState.js @@ -239,6 +239,7 @@ export default class ApplicationState { unlockApplication() { this.notifyOfState(ApplicationState.Unlocking); this.setAuthenticationInProgress(false); + KeysManager.get().updateScreenshotPrivacy(); this.locked = false; } diff --git a/src/lib/keysManager.js b/src/lib/keysManager.js index 08dc34ca..681243dc 100644 --- a/src/lib/keysManager.js +++ b/src/lib/keysManager.js @@ -1,6 +1,5 @@ import {Platform} from 'react-native'; import FlagSecure from 'react-native-flag-secure-android'; -import ApplicationState from "@Lib/ApplicationState" import FingerprintScanner from 'react-native-fingerprint-scanner'; import SF from './sfjs/sfjs' @@ -29,12 +28,6 @@ export default class KeysManager { } async loadInitialData() { - this.stateObserver = ApplicationState.get().addStateObserver((state) => { - if(state == ApplicationState.Unlocking) { - this.updateScreenshotPrivacy(); - } - }) - var storageKeys = ["auth_params", OfflineParamsKey, "user", FirstRunKey, StorageEncryptionKey]; return Promise.all([ @@ -184,7 +177,7 @@ export default class KeysManager { } updateScreenshotPrivacy(enabled) { - if(ApplicationState.isIOS) { + if(Platform.OS == "ios") { return; } diff --git a/src/screens/Authentication/Sources/AuthenticationSourceBiometric.js b/src/screens/Authentication/Sources/AuthenticationSourceBiometric.js index c74b2424..d6a78340 100644 --- a/src/screens/Authentication/Sources/AuthenticationSourceBiometric.js +++ b/src/screens/Authentication/Sources/AuthenticationSourceBiometric.js @@ -1,5 +1,5 @@ +import { Platform } from 'react-native'; import FingerprintScanner from 'react-native-fingerprint-scanner' -import ApplicationState from "@Lib/ApplicationState" import AuthenticationSource from "./AuthenticationSource" import KeysManager from "@Lib/keysManager" @@ -59,7 +59,7 @@ export default class AuthenticationSourceBiometric extends AuthenticationSource async authenticate() { this.didBegin(); - if(ApplicationState.isAndroid) { + if(Platform.OS == "android") { return FingerprintScanner.authenticate({ // onAttempt: this.handleInvalidAttempt }).then(() => {