Skip to content

Commit

Permalink
Improving logic behind vote and avoiding dups.
Browse files Browse the repository at this point in the history
  • Loading branch information
chrux committed Jul 24, 2019
1 parent c15deed commit c8fa58a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion resources/js/components/FormQuestionComponent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
class="btn btn-primary btn-lg btn-block"
type="button"
:disabled="!isValid"
@click="newQuestion">{{ $t('Create') }}</button>
@click.once="newQuestion">{{ $t('Create') }}</button>
</div>
</div>
</div>
Expand Down
8 changes: 4 additions & 4 deletions resources/js/components/SurveyInstanceComponent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
type="button"
class="btn btn-primary btn-lg btn-block"
:disabled="!isValid"
@click="vote"
@click.once="vote"
>{{ $t('Send') }}</button>
</div>
</div>
Expand Down Expand Up @@ -76,11 +76,11 @@ export default {
},
toggleOption(e) {
const maxCheck = this.question.maxCheck || 1;
if (this.selectedOptions.length === maxCheck) {
return;
}
if (e.selected) {
if (this.selectedOptions.length === maxCheck) {
return;
}
this.selectedOptions.push(e.option.id);
} else {
this.selectedOptions = this.selectedOptions.filter(id => id !== e.option.id);
Expand Down

0 comments on commit c8fa58a

Please sign in to comment.