Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'}\""
}
Expand Down
2 changes: 1 addition & 1 deletion android/app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<resources>
<string name="app_name">BrewTracker</string>
<string name="expo_system_ui_user_interface_style" translatable="false">automatic</string>
<string name="expo_runtime_version">3.2.5</string>
<string name="expo_runtime_version">3.2.6</string>
<string name="expo_splash_screen_resize_mode" translatable="false">contain</string>
<string name="expo_splash_screen_status_bar_translucent" translatable="false">false</string>
</resources>
6 changes: 3 additions & 3 deletions app.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -16,7 +16,7 @@
},
"edgeToEdgeEnabled": true,
"package": "com.brewtracker.android",
"versionCode": 190,
"versionCode": 191,
"permissions": [
"CAMERA",
"VIBRATE",
Expand Down Expand Up @@ -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"
}
Expand Down
4 changes: 2 additions & 2 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
@@ -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",
Expand Down
15 changes: 10 additions & 5 deletions src/components/recipes/AIAnalysisButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
/**
Expand Down Expand Up @@ -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 (
<TouchableOpacity
Expand Down Expand Up @@ -125,7 +129,8 @@ export function AIAnalysisIconButton({
}: Pick<AIAnalysisButtonProps, "loading" | "disabled" | "onPress" | "testID">) {
const theme = useTheme();
const styles = createAIStyles(theme);
const isDisabled = disabled || loading;
const { isOffline } = useNetwork();
const isDisabled = disabled || isOffline || loading;

return (
<TouchableOpacity
Expand Down
5 changes: 3 additions & 2 deletions src/services/brewing/OfflineMetricsCalculator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,10 @@ export class OfflineMetricsCalculator {
}
}

// Default attenuation if none specified
// Use 0% attenuation if no yeast is present (matches backend behavior)
// This results in FG = OG when there's no yeast
const averageAttenuation =
attenuationCount > 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;
Expand Down