Skip to content

Commit

Permalink
minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Megha-Dev-19 committed Oct 30, 2024
1 parent b1e2c5a commit 4101cbd
Showing 1 changed file with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const hasCreatePermission = hasPermission(
);

useEffect(() => {
if (Array.isArray(rolesData) && rolesData.length && !selectedGroup) {
if (Array.isArray(rolesData) && rolesData.length) {
setSelectedGroup(rolesData[0]);
}
}, [rolesData]);
Expand All @@ -60,6 +60,7 @@ function getLastProposalId() {
}

useEffect(() => {
setRolesData([]);
getRoleWiseData(treasuryDaoID).then((resp) => {
setRolesData(resp);
});
Expand All @@ -76,11 +77,16 @@ function checkProposalStatus(proposalId) {
Near.asyncView(treasuryDaoID, "get_proposal", {
id: proposalId,
}).then((result) => {
if (result.status === "Approved") {
setRefreshData(!refreshData);
if (Object.keys(result.votes).length === 1) {
if (result.status === "Approved") {
setRefreshData(!refreshData);
}
setToastStatus(result.status);
setVoteProposalId(proposalId);
setTxnCreated(false);
} else {
setTimeout(() => checkProposalStatus(proposalId), 1000);
}
setToastStatus(result.status);
setVoteProposalId(proposalId);
});
}

Expand Down

0 comments on commit 4101cbd

Please sign in to comment.