Skip to content

Commit

Permalink
minor change
Browse files Browse the repository at this point in the history
  • Loading branch information
Megha-Dev-19 committed Dec 29, 2024
1 parent 073ec5f commit 9bc29d3
Showing 1 changed file with 34 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -275,39 +275,46 @@ const findAffectedProposals = (callback) => {
}
};

const submitChangeRequest = () => {
setLoading(true);
function submitVotePolicyChangeTxn() {
setShowAffectedProposalsModal(false);
findAffectedProposals((shouldShowAffectedProposalsModal) => {
if (!showAffectedProposalsModal && shouldShowAffectedProposalsModal) {
setShowAffectedProposalsModal(true);
return;
}

setSubmittingChangeRequest(true);
const description = {
title: "Update policy - Voting Duration",
summary: `${context.accountId} requested to change voting duration from ${currentDurationDays} to ${durationDays}.`,
};
Near.call({
contractName: treasuryDaoID,
methodName: "add_proposal",
deposit,
args: {
proposal: {
description: encodeToMarkdown(description),
kind: {
ChangePolicyUpdateParameters: {
parameters: {
proposal_period:
(60 * 60 * 24 * durationDays).toString() + "000000000",
},
setSubmittingChangeRequest(true);
const description = {
title: "Update policy - Voting Duration",
summary: `${context.accountId} requested to change voting duration from ${currentDurationDays} to ${durationDays}.`,
};
Near.call({
contractName: treasuryDaoID,
methodName: "add_proposal",
deposit,
args: {
proposal: {
description: encodeToMarkdown(description),
kind: {
ChangePolicyUpdateParameters: {
parameters: {
proposal_period:
(60 * 60 * 24 * durationDays).toString() + "000000000",
},
},
},
},
});
},
});
}

const submitChangeRequest = () => {
setLoading(true);
if (showAffectedProposalsModal) {
submitVotePolicyChangeTxn();
} else {
findAffectedProposals((shouldShowAffectedProposalsModal) => {
if (!showAffectedProposalsModal && shouldShowAffectedProposalsModal) {
setShowAffectedProposalsModal(true);
return;
}
submitVotePolicyChangeTxn();
});
}
};

useEffect(() => {
Expand Down

0 comments on commit 9bc29d3

Please sign in to comment.