Skip to content

Commit

Permalink
Fix for incorrect initial coefficients in qv coefficient proposal
Browse files Browse the repository at this point in the history
  • Loading branch information
dankelleher committed May 14, 2024
1 parent b1e1273 commit f9fc318
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,18 @@ import { preventNegativeNumberInput } from '@utils/helpers';

interface Props {
className?: string;
currentCoefficients?: Coefficients;
onCoefficientsChange(value: Coefficients | undefined): void;
}

export function QVConfigurator({ className, onCoefficientsChange }: Props) {
const [coefficients, setCoefficients] = useState<Coefficients>([1000, 0, 0]);
export function QVConfigurator({
className,
onCoefficientsChange,
currentCoefficients,
}: Props) {
const [coefficients, setCoefficients] = useState<Coefficients>(
currentCoefficients ?? [1000, 0, 0],
);
const { connection } = useConnection();
const realm = useRealmQuery().data?.result;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,7 @@ export function VotingStructureSelector(props: Props) {
{isQVConfig(props.structure) && (
<QVConfigurator
className="mt-2"
currentCoefficients={props.currentStructure.qvCoefficients}
onCoefficientsChange={(value) => {
const newConfig = produce({ ...props.structure }, (data) => {
data.qvCoefficients = value ?? undefined;
Expand Down

0 comments on commit f9fc318

Please sign in to comment.