Skip to content

Commit

Permalink
fix: fix conflict between disable and lock
Browse files Browse the repository at this point in the history
  • Loading branch information
belopash committed Dec 6, 2024
1 parent 6c3454e commit 3c1aac1
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/pages/DelegationsPage/DelegationsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export function MyDelegations() {
locked: d.locked || false,
unlockedAt: d.unlockedAt || '',
}))}
disabled={!worker.delegations.some(d => !d.locked)}
disabled={isLoading}
/>
</Stack>
</TableCell>
Expand Down
1 change: 1 addition & 0 deletions src/pages/GatewaysPage/GatewayUnstake.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ export function GatewayUnstakeButton({
hidden={disabled}
title={
!disabled &&
source.locked &&
(source.unlockedAt ? (
<UnlocksTooltip timestamp={source.unlockedAt} />
) : (
Expand Down
2 changes: 1 addition & 1 deletion src/pages/WorkersPage/Worker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ export const Worker = ({ backPath }: { backPath: string }) => {
// FIXME: some issue with types
unlockedAt: (d as any).unlockedAt,
}))}
disabled={isLoading || !delegations?.some(d => !d.locked)}
disabled={isLoading}
/>
</Stack>
}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/WorkersPage/WorkerUndelegate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export function WorkerUndelegate({
return (
<>
<Tooltip
title={!disabled && unlockedAt && <UnlocksTooltip timestamp={unlockedAt} />}
title={!disabled && isLocked && unlockedAt && <UnlocksTooltip timestamp={unlockedAt} />}
placement="top"
>
<Box sx={{ position: 'relative', display: 'inline-flex', alignItems: 'center' }}>
Expand Down
6 changes: 5 additions & 1 deletion src/pages/WorkersPage/WorkerWithdraw.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,11 @@ export function WorkerWithdrawButton({
return (
<>
<Tooltip
title={!disabled && source.unlockedAt && <UnlocksTooltip timestamp={source.unlockedAt} />}
title={
!disabled &&
source.locked &&
source.unlockedAt && <UnlocksTooltip timestamp={source.unlockedAt} />
}
placement="top"
>
<Box sx={{ position: 'relative', display: 'inline-flex', alignItems: 'center' }}>
Expand Down

0 comments on commit 3c1aac1

Please sign in to comment.