Skip to content
This repository has been archived by the owner on Jun 15, 2022. It is now read-only.

Commit

Permalink
Authenticate onUnmount, 3.0.2 build 2
Browse files Browse the repository at this point in the history
  • Loading branch information
moughxyz committed Feb 2, 2019
1 parent 8c8a11a commit dbd27ee
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 7 deletions.
2 changes: 1 addition & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ android {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion

versionCode 3000020
versionCode 3000021
versionName "3.0.2"

multiDexEnabled true
Expand Down
2 changes: 1 addition & 1 deletion ios/StandardNotes/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
<string>2</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSAppTransportSecurity</key>
Expand Down
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"react-navigation-header-buttons": "^2.1.1",
"regenerator": "^0.13.3",
"sn-models": "0.1.13",
"standard-file-js": "0.3.40"
"standard-file-js": "0.3.41"
},
"devDependencies": {
"babel-jest": "^23.6.0",
Expand Down
9 changes: 9 additions & 0 deletions src/screens/Authentication/Authenticate.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,15 @@ export default class Authenticate extends Abstract {
}

componentWillUnmount() {

// Typically there should be no way to exit this window if it doesn't have a cancel option.
// However, on Android, you can press the hardware back button to dismiss it. We want to notify
// caller that this screen has unmounted
let onUnmount = this.getProp("onUnmount");
if(onUnmount) {
onUnmount();
}

super.componentWillUnmount();
ApplicationState.get().removeStateObserver(this.stateObserver);
}
Expand Down
4 changes: 3 additions & 1 deletion src/screens/Root.js
Original file line number Diff line number Diff line change
Expand Up @@ -217,10 +217,12 @@ export default class Root extends Abstract {
onSuccess: () => {
authProps.onAuthenticate();
this.authenticationInProgress = false;

if(this.dataLoaded) {
Sync.get().sync();
}
},
onUnmount: () => {
this.authenticationInProgress = false;
}
});
}
Expand Down

0 comments on commit dbd27ee

Please sign in to comment.