diff --git a/android/app/build.gradle b/android/app/build.gradle
index 4f82bcbf..6fb253cd 100644
--- a/android/app/build.gradle
+++ b/android/app/build.gradle
@@ -92,8 +92,8 @@ android {
applicationId 'com.brewtracker.android'
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
- versionCode 190
- versionName "3.2.5"
+ versionCode 191
+ versionName "3.2.6"
buildConfigField "String", "REACT_NATIVE_RELEASE_LEVEL", "\"${findProperty('reactNativeReleaseLevel') ?: 'stable'}\""
}
diff --git a/android/app/src/main/res/values/strings.xml b/android/app/src/main/res/values/strings.xml
index 15ad49bb..a7bd023e 100644
--- a/android/app/src/main/res/values/strings.xml
+++ b/android/app/src/main/res/values/strings.xml
@@ -1,7 +1,7 @@
BrewTracker
automatic
- 3.2.5
+ 3.2.6
contain
false
\ No newline at end of file
diff --git a/app.json b/app.json
index efc68f05..9d3b4108 100644
--- a/app.json
+++ b/app.json
@@ -3,7 +3,7 @@
"name": "BrewTracker",
"slug": "brewtracker-android",
"orientation": "portrait",
- "version": "3.2.5",
+ "version": "3.2.6",
"icon": "./assets/images/BrewTrackerAndroidLogo.png",
"scheme": "brewtracker",
"userInterfaceStyle": "automatic",
@@ -16,7 +16,7 @@
},
"edgeToEdgeEnabled": true,
"package": "com.brewtracker.android",
- "versionCode": 190,
+ "versionCode": 191,
"permissions": [
"CAMERA",
"VIBRATE",
@@ -58,7 +58,7 @@
}
},
"owner": "jackmisner",
- "runtimeVersion": "3.2.5",
+ "runtimeVersion": "3.2.6",
"updates": {
"url": "https://u.expo.dev/edf222a8-b532-4d12-9b69-4e7fbb1d41c2"
}
diff --git a/package-lock.json b/package-lock.json
index b19a2d81..db462527 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "brewtracker",
- "version": "3.2.5",
+ "version": "3.2.6",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "brewtracker",
- "version": "3.2.5",
+ "version": "3.2.6",
"license": "GPL-3.0-or-later",
"dependencies": {
"@expo/metro-runtime": "~6.1.2",
diff --git a/package.json b/package.json
index 536c73af..5802bc6c 100644
--- a/package.json
+++ b/package.json
@@ -1,7 +1,7 @@
{
"name": "brewtracker",
"main": "expo-router/entry",
- "version": "3.2.5",
+ "version": "3.2.6",
"license": "GPL-3.0-or-later",
"scripts": {
"start": "expo start",
diff --git a/src/components/recipes/AIAnalysisButton.tsx b/src/components/recipes/AIAnalysisButton.tsx
index bbf972f7..4aa68bc0 100644
--- a/src/components/recipes/AIAnalysisButton.tsx
+++ b/src/components/recipes/AIAnalysisButton.tsx
@@ -21,13 +21,13 @@
* ```
*/
-import React from "react";
import { TouchableOpacity, Text, ActivityIndicator, View } from "react-native";
import { MaterialIcons } from "@expo/vector-icons";
import { useTheme } from "@contexts/ThemeContext";
import { createAIStyles } from "@styles/ai/aiStyles";
import { TEST_IDS } from "@src/constants/testIDs";
+import { useNetwork } from "@/src/contexts/NetworkContext";
interface AIAnalysisButtonProps {
/**
@@ -75,9 +75,13 @@ export function AIAnalysisButton({
}: AIAnalysisButtonProps) {
const theme = useTheme();
const styles = createAIStyles(theme);
-
- const isDisabled = disabled || loading;
- const displayLabel = loading ? loadingLabel : label;
+ const { isOffline } = useNetwork();
+ const isDisabled = disabled || isOffline || loading;
+ const displayLabel = loading
+ ? loadingLabel
+ : isOffline
+ ? "Go Online to Analyse with AI"
+ : label;
return (
) {
const theme = useTheme();
const styles = createAIStyles(theme);
- const isDisabled = disabled || loading;
+ const { isOffline } = useNetwork();
+ const isDisabled = disabled || isOffline || loading;
return (
0 ? totalAttenuation / attenuationCount : 75; // Default 75% attenuation
+ attenuationCount > 0 ? totalAttenuation / attenuationCount : 0;
// Calculate FG: FG = OG - ((OG - 1) * attenuation/100)
const gravityPoints = (og - 1) * 1000;