Skip to content

Commit

Permalink
feat: default to_upgrade value (#69)
Browse files Browse the repository at this point in the history
Co-authored-by: Tomáš Hobza <[email protected]>
  • Loading branch information
2 people authored and Nerrolol committed May 12, 2024
1 parent c51f55a commit 04f6801
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions frontend/src/components/NewProposalForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default function NewProposalForm({

// State variables for the payload and to_upgrade
const [payload, setPayload] = React.useState<string>("");
const [to_upgrade, setToUpgrade] = React.useState<string>("");
const [to_upgrade, setToUpgrade] = React.useState<string>("0");

// Create a call to submit a proposal
const calls = useMemo(() => {
Expand Down Expand Up @@ -46,11 +46,13 @@ export default function NewProposalForm({
writeAsync()
.then(() => {
toast.success("Proposal submitted");
setIsModalOpen(false);
})
.catch((e) => {
toast.error("Something went wrong");
console.error(e);
})
.finally(() => {
setIsModalOpen(false);
});
}

Expand All @@ -69,6 +71,7 @@ export default function NewProposalForm({
id="#to_upgrade"
className="w-full p-2 border rounded-lg border-slate-300"
onChange={(e) => setToUpgrade(e.target.value)}
defaultValue={to_upgrade}
>
{/* Carmine 0 = amm, 1 = governance, 2 = CARM token, 3 = merkle tree root, 4 = no-op/signal vote */}
<option value="0">amm</option>
Expand Down

0 comments on commit 04f6801

Please sign in to comment.