Undo NaN filtering for graphs - 2.24 🚀

We published these changes, yet the error was still
occurring. Leaving this in just lowers performance
for no value.
This commit is contained in:
Brandon Presley 2024-02-15 13:12:16 +13:00
parent fd09758ccf
commit a9acc6f216
5 changed files with 9 additions and 13 deletions

View File

@ -19,8 +19,6 @@ export default function AppLineChart({ labels, data }: ChartProps) {
color: () => colors.primary,
};
const validData = useMemo(() => data.map(d => isNaN(d) ? 0 : d), [data])
const pruned = useMemo(() => {
if (labels.length < 3) return labels;
const newPruned = [labels[0]];
@ -41,7 +39,7 @@ export default function AppLineChart({ labels, data }: ChartProps) {
labels: pruned,
datasets: [
{
data: validData,
data,
},
],
}}

View File

@ -23,7 +23,7 @@ export default function AppPieChart({ options }: { options: Option[] }) {
const data = options.map((option, index) => ({
name: option.label,
value: isNaN(option.value) ? 0 : option.value,
value: option.value,
color: pieChartColors[index],
legendFontColor: colors.onSurface,
legendFontSize: 15,

View File

@ -36,11 +36,9 @@ export default function ViewGraph() {
}, []))
const convertWeight = (weight: number, unitFrom: string, unitTo: string) => {
let result = weight;
if (unitFrom === unitTo) result = weight;
if (unitFrom === 'lb' && unitTo === 'kg') result = weight * 0.453592;
if (unitFrom === 'kg' && unitTo === 'lb') result = weight * 2.20462;
return isNaN(result) ? 0 : result;
if (unitFrom === unitTo) return weight
if (unitFrom === 'lb' && unitTo === 'kg') return weight * 0.453592;
if (unitFrom === 'kg' && unitTo === 'lb') return weight * 2.20462;
};
useEffect(() => {

View File

@ -85,8 +85,8 @@ android {
applicationId "com.massive"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 36238
versionName "2.23"
versionCode 36239
versionName "2.24"
}
signingConfigs {
release {

View File

@ -1,6 +1,6 @@
{
"name": "massive",
"version": "2.23",
"version": "2.24",
"private": true,
"license": "GPL-3.0-only",
"scripts": {
@ -71,4 +71,4 @@
"engines": {
"node": ">=16"
}
}
}