diff --git a/instances/treasury-devdao.near/widget/components/DropDown.jsx b/instances/treasury-devdao.near/widget/components/DropDown.jsx index 48fafee6..7ea4b27f 100644 --- a/instances/treasury-devdao.near/widget/components/DropDown.jsx +++ b/instances/treasury-devdao.near/widget/components/DropDown.jsx @@ -49,6 +49,7 @@ return ( type="button" data-bs-toggle="dropdown" aria-expanded="false" + data-testid="dropdown-btn" > {selected.label} diff --git a/instances/treasury-devdao.near/widget/pages/settings/Thresholds.jsx b/instances/treasury-devdao.near/widget/pages/settings/Thresholds.jsx index 521a1553..f4e4a834 100644 --- a/instances/treasury-devdao.near/widget/pages/settings/Thresholds.jsx +++ b/instances/treasury-devdao.near/widget/pages/settings/Thresholds.jsx @@ -10,6 +10,9 @@ const { href } = VM.require("${REPL_DEVHUB}/widget/core.lib.url") || { href: () => {}, }; +if (typeof getRoleWiseData !== "function") { + return <>>; +} const [selectedGroup, setSelectedGroup] = useState(null); const [selectedVoteOption, setSelectedVoteOption] = useState(null); const [selectedVoteValue, setSelectedVoteValue] = useState(null); @@ -57,9 +60,9 @@ function getLastProposalId() { } useEffect(() => { - if (typeof getRoleWiseData === "function") { - getRoleWiseData(treasuryDaoID).then((resp) => setRolesData(resp)); - } + getRoleWiseData(treasuryDaoID).then((resp) => { + setRolesData(resp); + }); }, [refreshData]); useEffect(() => { @@ -230,7 +233,7 @@ function updateDaoPolicy() { weight_kind: "RoleWeight", quorum: "0", threshold: isPercentageSelected - ? [selectedVoteValue, 100] + ? [parseInt(selectedVoteValue), 100] : selectedVoteValue, }; return policy; @@ -350,7 +353,7 @@ return ( instance, heading: "Are you sure?", content: ( -