Skip to content

Commit

Permalink
show approval on edit budget
Browse files Browse the repository at this point in the history
  • Loading branch information
GrandSchtroumpf committed May 15, 2024
1 parent 57844fc commit c7f2cfb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/components/strategies/edit/EditStrategyBudgetContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { FormEvent, useMemo } from 'react';
import { getStatusTextByTxStatus } from '../utils';
import { isOverlappingStrategy } from '../overlapping/utils';
import { EditBudgetOverlappingStrategy } from './overlapping/EditBudgetOverlappingStrategy';
import { getDeposit, strategyHasChanged } from './utils';
import { getDeposit, strategyBudgetChanges, strategyHasChanged } from './utils';
import { cn } from 'utils/helpers';
import { useNextRender } from 'hooks/useNextRender';
import style from 'components/strategies/common/form.module.css';
Expand Down Expand Up @@ -65,7 +65,9 @@ export const EditStrategyBudgetContent = ({
const showApproval = !!useNextRender(() => {
const errors = document.querySelector('.error-message');
const warnings = !!document.querySelector('.warning-message');
return !errors && !!warnings;
const hasDistribution =
isOverlapping && strategyBudgetChanges(strategy, order0, order1);
return !errors && (!!warnings || hasDistribution);
});

const strategyEventData = useStrategyEventData({
Expand Down

0 comments on commit c7f2cfb

Please sign in to comment.