-
- {newVoteChoice}
-
- >}
- modalDescription={
-
}
- disabled={!newVoteChoice}
- onSubmit={onUpdateVoteChoice}
- buttonLabel={
}
- />
-);
diff --git a/app/components/views/ProposalDetails/helpers.js b/app/components/views/ProposalDetails/helpers.js
index a9bf615036..922d9362a3 100644
--- a/app/components/views/ProposalDetails/helpers.js
+++ b/app/components/views/ProposalDetails/helpers.js
@@ -1,9 +1,8 @@
import { shell } from "electron";
import { KeyBlueButton, InvisibleConfirmPoliteiaModalButton } from "buttons";
import { FormattedMessage as T } from "react-intl";
-import { StakeyBounceXs, VotingProgress, PoliteiaLoading } from "indicators";
+import { VotingProgress, PoliteiaLoading } from "indicators";
import { showCheck } from "helpers";
-import UpdateVoteChoiceModalButton from "./UpdateVoteChoiceModalButton";
import { default as ReactMarkdown } from "react-markdown";
import { FormattedRelative } from "shared";
@@ -32,36 +31,6 @@ export const NoElligibleTicketsVotingInfo = ({ showPurchaseTicketsPage }) => (
>
);
-const VoteOption = ({ value, description, onClick, checked }) => (
-
- onClick(value) : null}
- value={value} checked={checked} />
-
-);
-
-export const ChooseVoteOption = ({ voteOptions, onUpdateVoteChoice, setVoteOption, newVoteChoice, currentVoteChoice, votingComplete, eligibleTicketCount }) => (
- <>
-
-
-
- {voteOptions.map(o => (
-
- ))}
-
-
- {!votingComplete &&
}
- >
-);
-
-export const UpdatingVoteChoice = () => (
-
-
- ...
-
-);
-
export const OverviewField = showCheck(( { label, value } ) => (
{label}:
diff --git a/app/components/views/ProposalDetails/index.js b/app/components/views/ProposalDetails/index.js
index c2ce501150..edd2eb43cc 100644
--- a/app/components/views/ProposalDetails/index.js
+++ b/app/components/views/ProposalDetails/index.js
@@ -16,8 +16,6 @@ function ProposalDetails() {
let viewedProposalDetails;
let text = "";
- const [ showWalletEligibleTickets, toggleShowWalletEligibleTickets ] = useState(false);
- const [ newVoteChoice, setVoteOption ] = useState(null);
const { token } = useParams();
const proposalsDetails = useSelector(sel.proposalsDetails);
const getProposalError = useSelector(sel.getProposalError);
@@ -25,12 +23,6 @@ function ProposalDetails() {
const getProposalDetails = (token) => dispatch(gov.getProposalDetails(token));
const goBackHistory = () => dispatch(cli.goBackHistory());
- async function onUpdateVoteChoice(privatePassphrase) {
- if (!viewedProposalDetails || !newVoteChoice) return;
- await dispatch(gov.updateVoteChoice(viewedProposalDetails, newVoteChoice, privatePassphrase));
- return true;
- }
-
const [ state, send ] = useMachine(fetchMachine, {
actions: {
initial: () => {
@@ -55,11 +47,7 @@ function ProposalDetails() {
text += politeiaMarkdownIndexMd(f.payload);
}
});
- return
;
+ return
;
case "failure":
return
;
default:
diff --git a/app/reducers/governance.js b/app/reducers/governance.js
index efb14dcd9d..ddd6d58230 100644
--- a/app/reducers/governance.js
+++ b/app/reducers/governance.js
@@ -55,20 +55,14 @@ export default function governance(state = {}, action) {
},
proposals: { ...action.proposals }
};
- case UPDATEVOTECHOICE_ATTEMPT:
- return { ...state, updateVoteChoiceAttempt: true };
case UPDATEVOTECHOICE_SUCCESS:
return {
...state,
proposals: { ...action.proposals },
- updateVoteChoiceAttempt: false,
proposalsDetails: { ...state.proposalsDetails,
[action.token]: { ...action.proposal }
}
};
-
- case UPDATEVOTECHOICE_FAILED:
- return { ...state, updateVoteChoiceAttempt: false };
case WALLETREADY:
return { ...state,
lastPoliteiaAccessTime: action.lastPoliteiaAccessTime,
diff --git a/app/selectors.js b/app/selectors.js
index 702d66544c..37292f30db 100644
--- a/app/selectors.js
+++ b/app/selectors.js
@@ -996,7 +996,6 @@ export const allAgendas = createSelector(
export const treasuryBalance = get([ "grpc", "treasuryBalance" ]);
-export const updateVoteChoiceAttempt = get([ "governance", "updateVoteChoiceAttempt" ]);
export const proposals = get([ "governance", "proposals" ]);
export const proposallistpagesize = get([ "governance", "proposallistpagesize" ]);
export const getProposalsAttempt = get([ "governance", "getProposalsAttempt" ]);
diff --git a/app/stateMachines/FetchStateMachine.js b/app/stateMachines/FetchStateMachine.js
index e983c63e31..bab58d0432 100644
--- a/app/stateMachines/FetchStateMachine.js
+++ b/app/stateMachines/FetchStateMachine.js
@@ -4,7 +4,8 @@ export const fetchMachine = Machine({
id: "fetch",
initial: "idle",
context: {
- retries: 0
+ retries: 0,
+ error: null
},
states: {
idle: {
@@ -18,7 +19,12 @@ export const fetchMachine = Machine({
entry: [ "load" ],
on: {
RESOLVE: "success",
- REJECT: "failure"
+ REJECT: {
+ target: "failure",
+ actions: assign({
+ error: (context, event) => event.error
+ })
+ }
}
},
success: {