Skip to content

Commit f0eea73

Browse files
committed
fix(#3191): fix re-voting with a different rationale
1 parent 4cef738 commit f0eea73

File tree

4 files changed

+4
-9
lines changed

4 files changed

+4
-9
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ changes.
2222
### Changed
2323

2424
- Exclude network total stake and info from network metrics [Issue 3189](https://github.com/IntersectMBO/govtool/issues/3189)
25+
- Change restriction level for re-voting on governance actions [Issue 3191](https://github.com/IntersectMBO/govtool/issues/3191)
2526

2627
### Removed
2728

govtool/frontend/src/components/molecules/VoteActionForm.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ export const VoteActionForm = ({
4545
const {
4646
areFormErrors,
4747
confirmVote,
48-
isDirty,
4948
isVoteLoading,
5049
registerInput,
5150
setValue,
@@ -349,9 +348,7 @@ export const VoteActionForm = ({
349348
<Button
350349
data-testid="vote-button"
351350
variant="contained"
352-
disabled={
353-
!vote || previousVote?.vote === vote || (areFormErrors && isDirty)
354-
}
351+
disabled={!vote || areFormErrors}
355352
isLoading={isVoteLoading}
356353
onClick={confirmVote}
357354
size="extraLarge"

govtool/frontend/src/components/organisms/VoteContext/VoteContextText.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ export const VoteContextText = ({
2222
const isContinueDisabled = !watch("voteContextText");
2323

2424
const fieldProps = {
25-
key: "voteContextText",
2625
layoutStyles: { mb: 3 },
2726
name: "voteContextText",
2827
placeholder: t("govActions.provideContext"),
@@ -70,6 +69,7 @@ export const VoteContextText = ({
7069
<ControlledField.TextArea
7170
{...{ control, errors }}
7271
{...fieldProps}
72+
key="voteContextText"
7373
isModifiedLayout
7474
maxLength={MAX_LENGTH}
7575
data-testid="provide-context-input"

govtool/frontend/src/services/requests/getVoteContextTextFromFile.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,5 @@ export const getVoteContextTextFromFile = async (url: string | undefined) => {
77

88
const response = await axios.get(url);
99

10-
const voteContextText =
11-
response.data.body["CIP108:voteContextText"]["@value"];
12-
13-
return voteContextText;
10+
return response.data.body?.body?.comment ?? "";
1411
};

0 commit comments

Comments
 (0)