Skip to content

Commit

Permalink
Fix: APP-2563 - SDK updated & proposal approval button enabled (#1096)
Browse files Browse the repository at this point in the history
* sdk 1.17.1 to fix member with inactive delegation not showing up

* enable approval when wallet not connected
  • Loading branch information
Fabricevladimir authored Oct 27, 2023
1 parent 50c5b13 commit c9d58c0
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 13 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"dependencies": {
"@apollo/client": "^3.5.8",
"@aragon/ods": "^1.0.1",
"@aragon/sdk-client": "^1.16.3",
"@aragon/sdk-client": "^1.17.1",
"@elastic/apm-rum-react": "^2.0.0",
"@radix-ui/react-accordion": "^1.1.2",
"@radix-ui/react-dialog": "^1.0.4",
Expand Down
21 changes: 18 additions & 3 deletions src/pages/proposal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -516,19 +516,34 @@ export const Proposal: React.FC = () => {
isTokenVotingSettings(votingSettings) &&
votingSettings.votingMode === VotingMode.VOTE_REPLACEMENT;

const votingDisabled =
let votingDisabled =
(proposal && proposal.status !== ProposalStatus.ACTIVE) ||
(isMultisigPlugin && voted) ||
(isTokenVotingPlugin && voted && canRevote === false) ||
(canVote === false && shouldDisplayDelegationVoteGating === false);

if (!address) votingDisabled = false;

const handleApprovalClick = useCallback(
(tryExecution: boolean) => {
if (proposal?.id) {
if (address == null) {
open('wallet');
statusRef.current.wasNotLoggedIn = true;
} else if (isOnWrongNetwork) {
open('network');
statusRef.current.wasOnWrongNetwork = true;
} else if (canVote && proposal?.id) {
handlePrepareApproval({tryExecution, proposalId: proposal.id});
}
},
[handlePrepareApproval, proposal?.id]
[
address,
canVote,
handlePrepareApproval,
isOnWrongNetwork,
open,
proposal?.id,
]
);

const handleVoteClick = useCallback(() => {
Expand Down
18 changes: 9 additions & 9 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@
dependencies:
ethers "^5.6.2"

"@aragon/sdk-client-common@^1.7.1":
version "1.7.1"
resolved "https://registry.yarnpkg.com/@aragon/sdk-client-common/-/sdk-client-common-1.7.1.tgz#1d27cadd5a56591c37581295d899ae429c9a89b8"
integrity sha512-0kRFeQSgLeIO6Vh7FJ3YYRqjecSAXGrLsDdpTAFbtPlbeZgxc8T10WmPMFooaU3Eyv5TtIDrg8C5k+ytXhdpVA==
"@aragon/sdk-client-common@^1.9.0":
version "1.9.0"
resolved "https://registry.yarnpkg.com/@aragon/sdk-client-common/-/sdk-client-common-1.9.0.tgz#a433fc989394dcc6368bf013c7a2924bd754add1"
integrity sha512-t/TtBCOZp0jk+QhejVE35yYLuq1lVJIhLYcXupPst4zYsArVodRAk7Zlv09CqphXOcyPiClM4vMLRIOJQZxjZA==
dependencies:
"@aragon/osx-ethers" "^1.3.0-rc0.3"
"@aragon/osx-ethers-v1.0.0" "npm:@aragon/[email protected]"
Expand All @@ -91,13 +91,13 @@
graphql-request "^4.3.0"
yup "^1.2.0"

"@aragon/sdk-client@^1.16.3":
version "1.16.3"
resolved "https://registry.yarnpkg.com/@aragon/sdk-client/-/sdk-client-1.16.3.tgz#e2236259d7e9893d781c7d7b9aff758fb3fc18fd"
integrity sha512-YzBXgXj2ydBR6i/zowQmyNqSubF8EBPRiN7xMFoTffWdSJ0wjlUanIGmr055Jk5egm6Atw6kaCANGsW8aoFnnQ==
"@aragon/sdk-client@^1.17.1":
version "1.17.1"
resolved "https://registry.yarnpkg.com/@aragon/sdk-client/-/sdk-client-1.17.1.tgz#88f343327ca914a6d59392ad0928514894ea86ff"
integrity sha512-v31tGM+WFMPKtoLYx3BBDg58MqjqPYuJPPjXa7XvF6ChgojbWyzLkSHlZR56Zoff5mXT3k8neD2Y+BVWv01fFA==
dependencies:
"@aragon/osx-ethers" "1.3.0-rc0.3"
"@aragon/sdk-client-common" "^1.7.1"
"@aragon/sdk-client-common" "^1.9.0"
"@aragon/sdk-ipfs" "^1.1.0"
"@ethersproject/abstract-signer" "^5.5.0"
"@ethersproject/bignumber" "^5.6.0"
Expand Down

0 comments on commit c9d58c0

Please sign in to comment.