writeDistribute?.({
@@ -174,7 +163,9 @@ export function ProposalCard({
min={0}
max={memberActivatedPoints}
value={inputData?.value ?? 0}
- className={"range range-success range-sm min-w-[420px] cursor-pointer"}
+ className={
+ "range range-success range-sm min-w-[420px] cursor-pointer"
+ }
step={memberActivatedPoints / 100}
onChange={(e) => inputHandler(index, Number(e.target.value))}
/>
@@ -210,7 +201,7 @@ export function ProposalCard({
% of pool weight
- :
+ :
Assigning
{calcPoolWeightUsed(
diff --git a/apps/web/components/Proposals.tsx b/apps/web/components/Proposals.tsx
index e2f61ecb9..3d0c47cb6 100644
--- a/apps/web/components/Proposals.tsx
+++ b/apps/web/components/Proposals.tsx
@@ -26,7 +26,6 @@ import { useContractWriteWithConfirmations } from "@/hooks/useContractWriteWithC
import { ConditionObject, useDisableButtons } from "@/hooks/useDisableButtons";
import { useIsMemberActivated } from "@/hooks/useIsMemberActivated";
import { useSubgraphQuery } from "@/hooks/useSubgraphQuery";
-import { useTransactionNotification } from "@/hooks/useTransactionNotification";
import { alloABI, cvStrategyABI, registryCommunityABI } from "@/src/generated";
import { LightCVStrategy } from "@/types";
import { abiWithErrors, abiWithErrors2 } from "@/utils/abiWithErrors";
@@ -64,7 +63,7 @@ export function Proposals({
const [inputAllocatedTokens, setInputAllocatedTokens] = useState(0);
const [inputs, setInputs] = useState([]);
const [proposals, setProposals] = useState<
- Awaited>
+ Awaited>
>([]);
const [memberActivatedPoints, setMemberActivatedPoints] = useState(0);
const [stakedFilters, setStakedFilters] = useState([]);
@@ -170,17 +169,23 @@ export function Proposals({
if (fetchingProposals == null) {
setFetchingProposals(true);
}
- getProposals(wallet, strategy).then((res) => {
- if (res !== undefined) {
- setProposals(res);
- } else {
- console.debug("No proposals");
- }
- }).catch((err) => {
- console.error("Error while fetching proposals: ", { error: err, strategy });
- }).finally(() => {
- return setFetchingProposals(false);
- });
+ getProposals(wallet, strategy)
+ .then((res) => {
+ if (res !== undefined) {
+ setProposals(res);
+ } else {
+ console.debug("No proposals");
+ }
+ })
+ .catch((err) => {
+ console.error("Error while fetching proposals: ", {
+ error: err,
+ strategy,
+ });
+ })
+ .finally(() => {
+ return setFetchingProposals(false);
+ });
};
useEffect(() => {
@@ -218,7 +223,6 @@ export function Proposals({
}, [isMemberActived]);
const {
- transactionData: allocateTxData,
write: writeAllocate,
error: errorAllocate,
status: allocateStatus,
@@ -226,6 +230,8 @@ export function Proposals({
address: alloInfo.id as Address,
abi: abiWithErrors(alloABI),
functionName: "allocate",
+ contractName: "Allo",
+ fallbackErrorMessage: "Error allocating points. Please try again.",
onConfirmations: () => {
publish({
topic: "proposal",
@@ -238,12 +244,6 @@ export function Proposals({
});
useErrorDetails(errorAllocate, "errorAllocate");
- const { updateTransactionStatus } =
- useTransactionNotification(allocateTxData);
-
- useEffect(() => {
- updateTransactionStatus(allocateStatus);
- }, [allocateStatus]);
const submit = async () => {
const proposalsDifferencesArr = getProposalsInputsDifferences(
@@ -360,10 +360,10 @@ export function Proposals({