Skip to content

Commit

Permalink
fix: Default value for number winners
Browse files Browse the repository at this point in the history
  • Loading branch information
ChaituVR committed Jul 2, 2024
1 parent 2789c9d commit c3f92b3
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/views/SpaceBoost.vue
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ const form = ref<Form>({
weightedLimit: '',
hasLotteryLimit: false,
lotteryLimit: '',
numWinners: ''
numWinners: 1
},
network: '1',
token: undefined,
Expand Down Expand Up @@ -225,6 +225,11 @@ const strategy = computed<BoostStrategy>(() => {
eligibilityType = 'bribe';
}
const numWinners =
form.value.distribution.type === 'lottery'
? form.value.distribution.numWinners
: undefined;
return {
name: 'Boost',
description: 'Snapshot.org proposal boost',
Expand All @@ -242,7 +247,7 @@ const strategy = computed<BoostStrategy>(() => {
distribution: {
type: form.value.distribution.type,
limit: strategyDistributionLimit.value,
numWinners: form.value.distribution.numWinners || undefined
numWinners
}
}
};
Expand Down Expand Up @@ -495,11 +500,12 @@ watch(
if (form.value.distribution.type === 'lottery') {
form.value.distribution.hasWeightedLimit = false;
form.value.distribution.weightedLimit = '';
form.value.distribution.numWinners = 1;
}
if (form.value.distribution.type === 'weighted') {
form.value.distribution.hasLotteryLimit = false;
form.value.distribution.lotteryLimit = '';
form.value.distribution.numWinners = '';
form.value.distribution.numWinners = undefined;
}
},
{ deep: true }
Expand Down Expand Up @@ -619,7 +625,7 @@ watch(
<template v-if="form.distribution.type === 'lottery'">
<TuneInput
v-model="form.distribution.numWinners"
label="Number of winners"
default="1"
type="number"
placeholder="5"
always-show-error
Expand Down

0 comments on commit c3f92b3

Please sign in to comment.