Skip to content

Commit

Permalink
Prevent empty state from showing for ac sources.
Browse files Browse the repository at this point in the history
  • Loading branch information
fwaalkens committed Feb 21, 2024
1 parent 2a0ead1 commit 5585e0f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/app/Marine2/utils/hooks/use-available-energy-boxes.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {
useAcLoads,
useActiveSource,
useAlternators,
useDcLoads,
usePvCharger,
Expand All @@ -21,6 +22,7 @@ import { ISize } from "@m2Types/generic/size"
// Noticed some data inconsistencies (undefined values) when using this array.push method/prop data.
export const useAvailableEnergyBoxes = (compactBoxSize: ISize, componentMode?: ComponentMode) => {
const { inputId: shoreInputId } = useShorePowerInput()
const { activeInput } = useActiveSource()
const { phases } = useAcLoads()
const dcLoads = useDcLoads()
const pvCharger = usePvCharger()
Expand All @@ -29,7 +31,7 @@ export const useAvailableEnergyBoxes = (compactBoxSize: ISize, componentMode?: C

const boxes = []

if (shoreInputId) {
if (shoreInputId && activeInput) {
boxes.push(
<EnergyShore
key="energy-shore"
Expand Down

0 comments on commit 5585e0f

Please sign in to comment.