Skip to content

Commit

Permalink
fix: properly update ui on closing epoch flow
Browse files Browse the repository at this point in the history
  • Loading branch information
jpangelle committed Jun 23, 2021
1 parent f276137 commit 06244db
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions tinlake-ui/containers/Investment/View/EpochOverview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ const EpochOverview: React.FC<Props> = (props: Props) => {
return <Button label={`Execute epoch ${epochData?.id}`} primary disabled />
case 'challenge-period-ended':
return <Button label={`Execute epoch ${epochData?.id}`} primary onClick={execute} disabled={disabled} />
case 'open':
return <Button label="Close epoch" primary disabled />
default:
return null
}
Expand Down
6 changes: 4 additions & 2 deletions tinlake-ui/containers/Investment/View/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,12 @@ const InvestmentsView: React.FC<Props> = (props: Props) => {

const dispatch = useDispatch()
const address = useSelector<any, string | null>((state) => state.auth.address)
const activeTransactions = useSelector<any, string | null>((state) => state.transactions.active)
const portfolioData = useSelector<any, string | null>((state) => state.portfolio.data)

React.useEffect(() => {
dispatch(loadPool(props.tinlake))
}, [props.tinlake.signer, address])
dispatch(loadPool(props.tinlake, '', true))
}, [props.tinlake.signer, address, activeTransactions, portfolioData])

return (
<Box margin={{ top: 'medium' }}>
Expand Down

0 comments on commit 06244db

Please sign in to comment.