Skip to content

Commit

Permalink
✨ Update choices limits
Browse files Browse the repository at this point in the history
Closes #3
  • Loading branch information
Androz2091 committed Mar 20, 2021
1 parent 2837f4b commit 75fb32a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/components/SlashCommandOptionForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
</div>
<button
class="bg-discord px-2 p-2 text-white rounded focus:outline-none text-sm"
:disabled="choices.length === 10"
:disabled="choices.length === 25"
@click="choices.push({ name: '', value: '' })"
>
Add a new choice
Expand Down Expand Up @@ -203,7 +203,7 @@ export default {
if (nameMinLength) return 'The option name can not be shorter than 3 characters!';
const nameMaxLength = this.name.length > 32;
if (nameMaxLength) return 'The option name can not be longer than 32 characters!';
const invalidCharacters = !(/^[0-9a-zA-Z_]{3,32}$/.test(this.name));
const invalidCharacters = !(/^[0-9a-zA-Z_]+$/.test(this.name));
if (invalidCharacters) return 'Name contains invalid characters.';
return null;
},
Expand All @@ -229,7 +229,7 @@ export default {
},
watch: {
rawChoices () {
const maxChoicesReached = this.choices.length > 10;
const maxChoicesReached = this.choices.length > 25;
const emptyChoice = this.choices.filter((c) => !c).length > 1;
if (maxChoicesReached || emptyChoice) {
this.rawChoices = this.rawChoices.substr(0, this.rawChoices.length - 1);
Expand Down

0 comments on commit 75fb32a

Please # to comment.