Skip to content

Commit

Permalink
fix: disable vote option while loading
Browse files Browse the repository at this point in the history
Signed-off-by: Hamza Mahjoubi <[email protected]>
  • Loading branch information
hamza221 committed Aug 26, 2024
1 parent 7e41c26 commit 54334fe
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/js/components/VoteTable/VoteItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ export default {
},
},
data() {
return {
isLoading: false,
}
},
computed: {
...mapState({
currentUser: (state) => state.acl.currentUser,
Expand All @@ -51,6 +57,7 @@ export default {
&& this.isValidUser
&& !this.isPollClosed
&& !this.option.locked
&& !this.isLoading
},
isActive() {
Expand Down Expand Up @@ -94,6 +101,7 @@ export default {
methods: {
async setVote() {
this.isLoading = true
try {
await this.$store.dispatch('votes/set', {
option: this.option,
Expand All @@ -104,6 +112,8 @@ export default {
} catch (e) {
showError(t('polls', 'Error saving vote'))
} finally {
this.isLoading = false
}
},
},
Expand Down

0 comments on commit 54334fe

Please sign in to comment.