Skip to content

Commit

Permalink
🎖️ Fix on flashing validation when selecting staking account (#2852)
Browse files Browse the repository at this point in the history
(cherry picked from commit 3e9f687)
  • Loading branch information
WRadoslaw authored and thesan committed Apr 14, 2022
1 parent 1c9280c commit 41e0da6
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions packages/ui/src/memberships/model/validation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,13 @@ export const StakingAccountSchema = Yup.object()
!areLocksConflicting(validationContext.stakeLock, validationContext.balances.locks)
)
})
.test('stakingStatus', 'Account might be bound to another member', (value, context) => {
if (!value) {
return true
}

.test('otherStatus', 'This account is bound to another member', (value, context) => {
const { stakingStatus } = context.options.context as IStakingAccountSchema

return stakingStatus !== 'unknown' && stakingStatus !== 'other'
return stakingStatus !== 'other'
})
.test('unknownStatus', '', (value, context) => {
const { stakingStatus } = context.options.context as IStakingAccountSchema
return stakingStatus !== 'unknown'
})

export const NewAddressSchema = (which: string) =>
Expand Down

0 comments on commit 41e0da6

Please sign in to comment.