Skip to content

Commit

Permalink
SOV-4618: Adjust governor in proclamation proposals
Browse files Browse the repository at this point in the history
  • Loading branch information
pietro-maximoff committed Dec 9, 2024
1 parent 28b7aa1 commit fbb789d
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ export const ProposalDataForm: FC<ProposalDataFormProps> = ({
details: form,
setDetails: setForm,
} = useProposalContext();
const [governorOwner, setGovernorOwner] = useState('');
const [index, setIndex] = useState(0);
const handleInputChangeInput = useCallback(
(event: ChangeEvent<HTMLInputElement>) => {
Expand Down Expand Up @@ -147,13 +146,12 @@ export const ProposalDataForm: FC<ProposalDataFormProps> = ({
);

useEffect(() => {
if (proposalType === ProposalCreationType.Proclamation && !governorOwner) {
getProtocolContract(Governor.Admin, RSK_CHAIN_ID).then(owner => {
setGovernorOwner(owner.address);
setGovernor(owner.address);
if (proposalType === ProposalCreationType.Proclamation) {
getProtocolContract(Governor.Admin, RSK_CHAIN_ID).then(admin => {
setGovernor(admin.address);
});
}
}, [governorOwner, proposalType, setGovernor, setGovernorOwner]);
}, [proposalType, setGovernor]);

return (
<div className="flex flex-col gap-8 relative pb-4">
Expand Down

0 comments on commit fbb789d

Please sign in to comment.