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

Commit

Permalink
Merge pull request #48 from mslipenchuk267/staging
Browse files Browse the repository at this point in the history
Final UX Enhancements
  • Loading branch information
mslipenchuk267 committed Dec 7, 2020
2 parents 1df3405 + 5a13262 commit a664def
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 11 deletions.
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@ android {
applicationId "com.parliament_temple"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 7
versionName "0.3"
versionCode 11
versionName "0.5"
missingDimensionStrategy 'react-native-camera', 'general' // for camera permissions
}
splits {
Expand Down
Binary file modified android/app/release/app-release.aab
Binary file not shown.
4 changes: 2 additions & 2 deletions ios/parliament.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -750,7 +750,7 @@
INFOPLIST_FILE = parliament/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 12.4;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 0.3;
MARKETING_VERSION = 0.5;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
Expand All @@ -777,7 +777,7 @@
INFOPLIST_FILE = parliament/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 12.4;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 0.3;
MARKETING_VERSION = 0.5;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
Expand Down
9 changes: 7 additions & 2 deletions screens/StartupScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,12 @@ const StartupScreen = () => {
userAuth.refreshToken,
userAuth.refreshTokenExpiration
));
await dispatch(userActions.refreshTokens())
try {
await dispatch(userActions.refreshTokens())
} catch (error) {
dispatch(userActions.setDidTryAutoLogin());
return;
}
// User's auth state is set updated in redux and secure store, lets boot user into UserNavigator
dispatch(userActions.setDidTryAutoLogin());
return;
Expand All @@ -67,7 +72,7 @@ const StartupScreen = () => {
}, [dispatch]);

return (
<View style={styles.container}/>
<View style={styles.container} />
)
}

Expand Down
6 changes: 3 additions & 3 deletions screens/qr/QRResultsScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ const QRResultsScreen = (props) => {
text: "Yes", onPress: async () => {
console.log("QRResultsScreen.js/handleVolunteerDataPress() - User Pressed Yes")
console.log("QRResultsScreen.js/handleVolunteerDataPress() - User's accessToken expiration is", accessTokenExpiration)
if (isRefreshNeeded(accessTokenExpiration)) {
await dispatch(userActions.refreshTokens())
}
//if (isRefreshNeeded(accessTokenExpiration)) {
await dispatch(userActions.refreshTokens());
//}
await uploadTempIDs(tempIDs, accessToken);
}
}
Expand Down
9 changes: 7 additions & 2 deletions store/actions/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -344,9 +344,10 @@ export const refreshTokens = () => {
const resData = await result.json()

// Error Check
if (resData.error) {
if (!resData.auth.accessToken) {
// alert user to error
alert(resData.error)
//alert(resData.error)
await deleteUserAuth();
return;
}
console.log("store/actions/user.js/refreshTokens() - Refresh Request Successful")
Expand All @@ -363,6 +364,10 @@ export const refreshTokens = () => {
"refreshToken": resData.auth.refreshToken,
"refreshTokenExpiration": resData.auth.refreshTokenExpiration,
}
const deviceKey = getState().user.deviceToken;
if (deviceKey) {
await uploadDeviceToken(getState().user.deviceToken, resData.auth.accessToken);
}
await deleteUserAuth();
await saveUserAuth(userAuth);
}
Expand Down

0 comments on commit a664def

Please sign in to comment.