Skip to content

Commit

Permalink
Clean up the initial state a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
adamgall committed Dec 5, 2024
1 parent 33fbc8f commit 7264577
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
11 changes: 2 additions & 9 deletions src/components/DaoCreator/formComponents/EstablishEssentials.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ export function EstablishEssentials(props: ICreationStepProps) {
// If in governance edit mode and snapshot URL is already set, disable the field
const snapshotENSDisabled = isEdit && !!subgraphInfo?.daoSnapshotENS;

props.onGovernanceTypeChange(values.essentials.governance);
const handleGovernanceChange = (value: string) => {
if (value === GovernanceType.AZORIUS_ERC20) {
setFieldValue('azorius.votingStrategyType', VotingStrategyType.LINEAR_ERC20);
Expand All @@ -63,6 +64,7 @@ export function EstablishEssentials(props: ICreationStepProps) {
}

setFieldValue('essentials.governance', value);
props.onGovernanceTypeChange(value as GovernanceType);
};

const { createOptions } = useNetworkConfig();
Expand Down Expand Up @@ -128,9 +130,6 @@ export function EstablishEssentials(props: ICreationStepProps) {
description={t('descAzoriusErc20Gov')}
testId="choose-azorius"
value={GovernanceType.AZORIUS_ERC20}
onClick={() => {
props.onGovernanceTypeChange(GovernanceType.AZORIUS_ERC20);
}}
/>
)}
{createOptions.includes(GovernanceType.AZORIUS_ERC721) && (
Expand All @@ -139,9 +138,6 @@ export function EstablishEssentials(props: ICreationStepProps) {
description={t('descAzoriusErc721Gov')}
testId="choose-azorius-erc721"
value={GovernanceType.AZORIUS_ERC721}
onClick={() => {
props.onGovernanceTypeChange(GovernanceType.AZORIUS_ERC721);
}}
/>
)}
{createOptions.includes(GovernanceType.MULTISIG) && (
Expand All @@ -150,9 +146,6 @@ export function EstablishEssentials(props: ICreationStepProps) {
description={t('descMultisigGov')}
testId="choose-multisig"
value={GovernanceType.MULTISIG}
onClick={() => {
props.onGovernanceTypeChange(GovernanceType.MULTISIG);
}}
/>
)}
</RadioGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/components/DaoCreator/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ function DaoCreator({
const { prepareMultisigFormData, prepareAzoriusERC20FormData, prepareAzoriusERC721FormData } =
usePrepareFormData();

const [totalSteps, setTotalSteps] = useState(3);
const [totalSteps, setTotalSteps] = useState(0);

return (
<Box>
Expand Down

0 comments on commit 7264577

Please sign in to comment.