Skip to content

Commit

Permalink
fix: weighted vote min max (#41)
Browse files Browse the repository at this point in the history
* fix: weighted vote min max

* fix: remove vote btn test

* fix: add deposit max

* fix: remove ezero weight to be added

* fix: remove test
  • Loading branch information
alexiscolin authored Mar 26, 2024
1 parent 3f760a3 commit 8cdc43e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/components/popups/ProposalDeposit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ const signDeposit = async () => {
placeholder="e.g. 50"
:label="$t('components.ProposalDeposit.instructions')"
:min="0"
:max="Infinity"
class="w-full justify-end"
/>
</form>
Expand Down
1 change: 1 addition & 0 deletions src/components/popups/ProposalVote.vue
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ const signVote = async () => {
},
],
};
voteOptions.options = voteOptions.options.filter((opt) => opt.weight !== "0");
} else {
if (!voteStraight.value) return;
voteOptions = {
Expand Down
4 changes: 4 additions & 0 deletions src/components/ui/UiInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
:max="type === 'number' ? max : undefined"
@focus="focusHandler(true)"
@blur="focusHandler(false)"
@input="typeof model === 'number' ? (model = MaxValue(MinValue(model))) : model"
/>
</label>
<Transition
Expand Down Expand Up @@ -56,6 +57,9 @@ const props = withDefaults(defineProps<Props>(), {
const focused = ref(false);
const MinValue = (val: number) => Math.min(props.max, val);
const MaxValue = (val: number) => Math.max(props.min, val);
const emit = defineEmits(["update:modelValue", "focus"]);
const model = computed({
get: () => props.modelValue,
Expand Down

0 comments on commit 8cdc43e

Please sign in to comment.