diff --git a/src/people/interfaces.ts b/src/people/interfaces.ts index 1fbee6b8..9d810136 100644 --- a/src/people/interfaces.ts +++ b/src/people/interfaces.ts @@ -328,7 +328,7 @@ export interface CodingBountiesProps extends WantedSummaryProps { id?: number; completed?: boolean; payment_pending?: boolean; - payment_falied?: boolean; + payment_failed?: boolean; localPaid: LocalPaymeentState; setLocalPaid: (state: LocalPaymeentState) => void; localCompleted: LocalCompletedState; diff --git a/src/people/widgetViews/BudgetWrap.tsx b/src/people/widgetViews/BudgetWrap.tsx index b8345725..3dca2f40 100644 --- a/src/people/widgetViews/BudgetWrap.tsx +++ b/src/people/widgetViews/BudgetWrap.tsx @@ -109,6 +109,22 @@ export const BudgetWrapComponent = (props: { org: Workspace | undefined; uuid: s } }, [main, uuid, viewReportDisabled]); + const updateWorkspaceBudget = useCallback(async () => { + main + .updateWorkspacePayments(uuid) + .then(() => { + getPaymentsHistory(); + }) + .catch((e: any) => { + console.log('Update Payment Histories error', e); + }); + }, [main, getPaymentsHistory]); + + const openPaymentHistory = () => { + updateWorkspaceBudget(); + setIsOpenHistory(true); + }; + let interval; const successAction = () => { @@ -171,7 +187,7 @@ export const BudgetWrapComponent = (props: { org: Workspace | undefined; uuid: s dataTestId="workspace-view-transaction-history-button" color="white" style={{ borderRadius: '5px' }} - onClick={() => setIsOpenHistory(true)} + onClick={() => openPaymentHistory()} />