Skip to content

Commit

Permalink
Changes:
Browse files Browse the repository at this point in the history
- moved server blocking code
- bumpped up app version

Signed-off-by: sarthakpranesh <sarthakpranesh08@gmail.com>
  • Loading branch information
sarthakpranesh committed Nov 29, 2021
1 parent 4f026f6 commit 8463bbc
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
17 changes: 9 additions & 8 deletions App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,25 +68,26 @@ export default function App() {
useEffect(() => {
(async () => {
await SplashScreen.preventAutoHideAsync();
const [isPlantServiceUp, cameraPer, pickerPer] = await Promise.all([
isServiceAvailable(),
const [cameraPer, pickerPer] = await Promise.all([
Camera.requestPermissionsAsync(),
ImagePicker.requestMediaLibraryPermissionsAsync(),
]);
setHasPermissionCamera(cameraPer.status === "granted");
setHasPermissionPicker(pickerPer.status === "granted");
setAppIsReady(true);
await analytics().logEvent("app_open", {
time: Date.now(),
});
// Calling the service last to make sure it's not blocking app startup due to Heroku server sleep
const isPlantServiceUp = await isServiceAvailable();
if (!isPlantServiceUp) {
Alert.alert(
"Oh! Snap",
"The service is currently unavailable, please check later!",
[{ text: "Close App", onPress: () => BackHandler.exitApp() }]
);
}
setHasPermissionCamera(cameraPer.status === "granted");
setHasPermissionPicker(pickerPer.status === "granted");
setAppIsReady(true);
setRecognized(isPlantServiceUp.recognized);
await analytics().logEvent("app_open", {
time: Date.now(),
});
})();
}, []);

Expand Down
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,8 @@ android {
applicationId "com.plantrecog"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 10
versionName "0.8.0"
versionCode 11
versionName "0.9.0"
}
splits {
abi {
Expand Down
2 changes: 1 addition & 1 deletion app.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"expo": {
"name": "PlantRecog",
"slug": "PlantRecog",
"version": "0.8.0",
"version": "0.9.0",
"assetBundlePatterns": [
"**/*"
]
Expand Down

0 comments on commit 8463bbc

Please sign in to comment.