replaced uses of getGrainUnit to the users grainUnit function to pull form logged in users settings rather than local storage
This commit is contained in:
parent
dc54f99abd
commit
cabc0146ed
22 changed files with 146 additions and 250 deletions
|
|
@ -40,7 +40,7 @@ import { FullScreen, useFullScreenHandle } from "react-full-screen";
|
|||
import moment, { Moment } from "moment";
|
||||
import ResponsiveDialog from "common/ResponsiveDialog";
|
||||
import { getThemeType } from "theme";
|
||||
import { getGrainUnit, or } from "utils";
|
||||
import { or } from "utils";
|
||||
import { useBinAPI } from "providers/pond/binAPI";
|
||||
import BindaptIcon from "products/Bindapt/BindaptIcon";
|
||||
import {
|
||||
|
|
@ -498,9 +498,9 @@ export default function BinVisualizer(props: Props) {
|
|||
if (bin.storage() === pond.BinStorage.BIN_STORAGE_FERTILIZER) {
|
||||
return Math.round(val * 35.239 * 100) / 100;
|
||||
} else {
|
||||
if (getGrainUnit() === pond.GrainUnit.GRAIN_UNIT_TONNE && bin.bushelsPerTonne() > 1) {
|
||||
if (user.grainUnit() === pond.GrainUnit.GRAIN_UNIT_TONNE && bin.bushelsPerTonne() > 1) {
|
||||
return Math.round((val / bin.bushelsPerTonne()) * 100) / 100;
|
||||
} else if (getGrainUnit() === pond.GrainUnit.GRAIN_UNIT_TON && bin.bushelsPerTonne() > 1) {
|
||||
} else if (user.grainUnit() === pond.GrainUnit.GRAIN_UNIT_TON && bin.bushelsPerTonne() > 1) {
|
||||
return Math.round((val / (bin.bushelsPerTonne()*0.907)) * 100) / 100;
|
||||
}
|
||||
}
|
||||
|
|
@ -516,9 +516,9 @@ export default function BinVisualizer(props: Props) {
|
|||
if (bin.storage() === pond.BinStorage.BIN_STORAGE_FERTILIZER) {
|
||||
return " / " + capacity.toLocaleString() + " L";
|
||||
}
|
||||
if (getGrainUnit() === pond.GrainUnit.GRAIN_UNIT_TONNE && bin.bushelsPerTonne() > 1) {
|
||||
if (user.grainUnit() === pond.GrainUnit.GRAIN_UNIT_TONNE && bin.bushelsPerTonne() > 1) {
|
||||
return "mT (" + bin.fillPercent() + "%)";
|
||||
} else if (getGrainUnit() === pond.GrainUnit.GRAIN_UNIT_TON && bin.bushelsPerTonne() > 1) {
|
||||
} else if (user.grainUnit() === pond.GrainUnit.GRAIN_UNIT_TON && bin.bushelsPerTonne() > 1) {
|
||||
return "t (" + bin.fillPercent() + "%)";
|
||||
} else {
|
||||
return " / " + capacity.toLocaleString() + " bu";
|
||||
|
|
@ -1328,14 +1328,14 @@ export default function BinVisualizer(props: Props) {
|
|||
}
|
||||
}
|
||||
|
||||
if (getGrainUnit() === pond.GrainUnit.GRAIN_UNIT_TONNE && bin.bushelsPerTonne() > 1) {
|
||||
if (user.grainUnit() === pond.GrainUnit.GRAIN_UNIT_TONNE && bin.bushelsPerTonne() > 1) {
|
||||
diffDisplay = diffDisplay / bin.bushelsPerTonne();
|
||||
if (pendingDisplay) {
|
||||
pendingDisplay = pendingDisplay / bin.bushelsPerTonne();
|
||||
}
|
||||
}
|
||||
|
||||
if (getGrainUnit() === pond.GrainUnit.GRAIN_UNIT_TON && bin.bushelsPerTonne() > 1) {
|
||||
if (user.grainUnit() === pond.GrainUnit.GRAIN_UNIT_TON && bin.bushelsPerTonne() > 1) {
|
||||
diffDisplay = diffDisplay / (bin.bushelsPerTonne()*0.907);
|
||||
if (pendingDisplay) {
|
||||
pendingDisplay = pendingDisplay / (bin.bushelsPerTonne()*0.907);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue