Skip to content

Commit

Permalink
Fix bug with start unlock
Browse files Browse the repository at this point in the history
  • Loading branch information
ChewingGlass committed Jul 25, 2024
1 parent 28daf0a commit f28e583
Show file tree
Hide file tree
Showing 5 changed files with 222 additions and 218 deletions.
4 changes: 2 additions & 2 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ PODS:
- ReactCommon/turbomodule/core (= 0.71.5)
- fmt (6.2.1)
- glog (0.3.5)
- helium-react-native-sdk (3.0.4):
- helium-react-native-sdk (3.0.5):
- React-Core
- hermes-engine (0.71.5):
- hermes-engine/Pre-built (= 0.71.5)
Expand Down Expand Up @@ -864,7 +864,7 @@ SPEC CHECKSUMS:
FBReactNativeSpec: 627fd07f1b9d498c9fa572e76d7f1a6b1ee9a444
fmt: ff9d55029c625d3757ed641535fd4a75fedc7ce9
glog: 04b94705f318337d7ead9e6d17c019bd9b1f6b1b
helium-react-native-sdk: bd924fa4ff053a6afb2b2febf03c3dfacd7dd671
helium-react-native-sdk: 54928dcd95ea131437ac6e269cf5bb2d473bf57f
hermes-engine: 0784cadad14b011580615c496f77e0ae112eed75
libevent: 4049cae6c81cdb3654a443be001fb9bdceff7913
lottie-ios: e047b1d2e6239b787cc5e9755b988869cf190494
Expand Down
44 changes: 22 additions & 22 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,34 +27,34 @@
"@coral-xyz/anchor": "^0.28.0",
"@gorhom/bottom-sheet": "4.6.0",
"@gorhom/portal": "1.0.14",
"@helium/account-fetch-cache": "0.9.0-alpha.7",
"@helium/account-fetch-cache-hooks": "0.9.0-alpha.7",
"@helium/account-fetch-cache": "0.9.0-alpha.9",
"@helium/account-fetch-cache-hooks": "0.9.0-alpha.9",
"@helium/address": "4.10.2",
"@helium/circuit-breaker-sdk": "^0.9.0-alpha.7",
"@helium/circuit-breaker-sdk": "^0.9.0-alpha.9",
"@helium/crypto-react-native": "4.8.0",
"@helium/currency-utils": "^0.9.0-alpha.7",
"@helium/data-credits-sdk": "^0.9.0-alpha.7",
"@helium/distributor-oracle": "0.9.0-alpha.7",
"@helium/fanout-sdk": "^0.9.0-alpha.7",
"@helium/helium-entity-manager-sdk": "^0.9.0-alpha.7",
"@helium/helium-react-hooks": "0.9.0-alpha.7",
"@helium/helium-sub-daos-sdk": "^0.9.0-alpha.7",
"@helium/currency-utils": "^0.9.0-alpha.9",
"@helium/data-credits-sdk": "^0.9.0-alpha.9",
"@helium/distributor-oracle": "0.9.0-alpha.9",
"@helium/fanout-sdk": "^0.9.0-alpha.9",
"@helium/helium-entity-manager-sdk": "^0.9.0-alpha.9",
"@helium/helium-react-hooks": "0.9.0-alpha.9",
"@helium/helium-sub-daos-sdk": "^0.9.0-alpha.9",
"@helium/http": "4.7.5",
"@helium/idls": "0.9.0-alpha.7",
"@helium/lazy-distributor-sdk": "^0.9.0-alpha.7",
"@helium/idls": "0.9.0-alpha.9",
"@helium/lazy-distributor-sdk": "^0.9.0-alpha.9",
"@helium/modular-governance-hooks": "^0.0.8",
"@helium/modular-governance-idls": "0.0.8-next.22+7098baa",
"@helium/onboarding": "4.11.0",
"@helium/organization-sdk": "^0.0.8",
"@helium/proto-ble": "4.0.0",
"@helium/react-native-sdk": "3.0.5",
"@helium/spl-utils": "0.9.0-alpha.7",
"@helium/spl-utils": "0.9.0-alpha.9",
"@helium/state-controller-sdk": "^0.0.8",
"@helium/sus": "0.9.0-alpha.7",
"@helium/sus": "0.9.0-alpha.9",
"@helium/transactions": "4.8.1",
"@helium/treasury-management-sdk": "^0.9.0-alpha.7",
"@helium/voter-stake-registry-hooks": "0.9.0-alpha.7",
"@helium/voter-stake-registry-sdk": "0.9.0-alpha.7",
"@helium/treasury-management-sdk": "^0.9.0-alpha.9",
"@helium/voter-stake-registry-hooks": "0.9.0-alpha.9",
"@helium/voter-stake-registry-sdk": "0.9.0-alpha.9",
"@helium/wallet-link": "4.11.0",
"@jup-ag/api": "^6.0.6",
"@ledgerhq/hw-app-solana": "7.0.13",
Expand Down Expand Up @@ -266,11 +266,11 @@
},
"resolutions": {
"@types/react": "17",
"@helium/account-fetch-cache": "^0.9.0-alpha.7",
"@helium/account-fetch-cache-hooks": "^0.9.0-alpha.7",
"@helium/helium-react-hooks": "^0.9.0-alpha.7",
"@helium/voter-stake-registry-hooks": "^0.9.0-alpha.7",
"@helium/voter-stake-registry-sdk": "^0.9.0-alpha.7",
"@helium/account-fetch-cache": "^0.9.0-alpha.9",
"@helium/account-fetch-cache-hooks": "^0.9.0-alpha.9",
"@helium/helium-react-hooks": "^0.9.0-alpha.9",
"@helium/voter-stake-registry-hooks": "^0.9.0-alpha.9",
"@helium/voter-stake-registry-sdk": "^0.9.0-alpha.9",
"@helium/modular-governance-hooks": "^0.0.8",
"@helium/onboarding": "4.11.0"
},
Expand Down
138 changes: 71 additions & 67 deletions src/features/governance/PositionCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -541,73 +541,77 @@ export const PositionCard = ({
/>
) : (
<>
<ListItem
key="split"
title="Split"
onPress={() => {
setActionsOpen(false)
if (hasActiveVotes) {
showOKAlert({
title: t('gov.positions.unableToSplit'),
message: t('gov.positions.partakingInVote'),
})
} else {
setIsSplitModalOpen(true)
}
}}
selected={false}
hasPressedState={false}
/>
<ListItem
key="transfer"
title="Transfer"
onPress={() => {
setActionsOpen(false)
if (hasActiveVotes) {
showOKAlert({
title: t('gov.positions.unableToTransfer'),
message: t('gov.positions.partakingInVote'),
})
} else {
setIsTransferModalOpen(true)
}
}}
selected={false}
hasPressedState={false}
/>
<ListItem
key="extend"
title={t('gov.positions.extend')}
onPress={() => {
setActionsOpen(false)
setIsExtendModalOpen(true)
}}
selected={false}
hasPressedState={false}
/>
<ListItem
key="pause"
title={
isConstant
? t('gov.transactions.unpauseLockup')
: t('gov.transactions.pauseLockup')
}
onPress={async () => {
setActionsOpen(false)
if (hasActiveVotes) {
showOKAlert({
title: isConstant
? t('gov.positions.unableToUnpauseLockup')
: t('gov.positions.unableToPauseLockup'),
message: t('gov.positions.partakingInVote'),
})
} else {
actionRef.current = 'flipLockupKind'
}
}}
selected={false}
hasPressedState={false}
/>
{!position.isProxiedToMe && (
<>
<ListItem
key="split"
title="Split"
onPress={() => {
setActionsOpen(false)
if (hasActiveVotes) {
showOKAlert({
title: t('gov.positions.unableToSplit'),
message: t('gov.positions.partakingInVote'),
})
} else {
setIsSplitModalOpen(true)
}
}}
selected={false}
hasPressedState={false}
/>
<ListItem
key="transfer"
title="Transfer"
onPress={() => {
setActionsOpen(false)
if (hasActiveVotes) {
showOKAlert({
title: t('gov.positions.unableToTransfer'),
message: t('gov.positions.partakingInVote'),
})
} else {
setIsTransferModalOpen(true)
}
}}
selected={false}
hasPressedState={false}
/>
<ListItem
key="extend"
title={t('gov.positions.extend')}
onPress={() => {
setActionsOpen(false)
setIsExtendModalOpen(true)
}}
selected={false}
hasPressedState={false}
/>
<ListItem
key="pause"
title={
isConstant
? t('gov.transactions.unpauseLockup')
: t('gov.transactions.pauseLockup')
}
onPress={async () => {
setActionsOpen(false)
if (hasActiveVotes) {
showOKAlert({
title: isConstant
? t('gov.positions.unableToUnpauseLockup')
: t('gov.positions.unableToPauseLockup'),
message: t('gov.positions.partakingInVote'),
})
} else {
actionRef.current = 'flipLockupKind'
}
}}
selected={false}
hasPressedState={false}
/>
</>
)}
{canDelegate && !position.isDelegated && (
<ListItem
key="delegate"
Expand Down
2 changes: 1 addition & 1 deletion src/features/governance/PositionsList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ export const PositionsList = ({ header, ...boxProps }: IPositionsListProps) => {
<Box
flexDirection="row"
alignItems="center"
paddingTop="xl"
paddingTop="m"
paddingBottom="m"
paddingHorizontal="l"
backgroundColor="primaryBackground"
Expand Down
Loading

0 comments on commit f28e583

Please sign in to comment.