From 54334fe4e74f5a555ad1fdfa83b51c6b82a7da91 Mon Sep 17 00:00:00 2001 From: Hamza Mahjoubi Date: Mon, 26 Aug 2024 17:42:29 +0200 Subject: [PATCH] fix: disable vote option while loading Signed-off-by: Hamza Mahjoubi --- src/js/components/VoteTable/VoteItem.vue | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/js/components/VoteTable/VoteItem.vue b/src/js/components/VoteTable/VoteItem.vue index 2b941b200..794c3dd3a 100644 --- a/src/js/components/VoteTable/VoteItem.vue +++ b/src/js/components/VoteTable/VoteItem.vue @@ -35,6 +35,12 @@ export default { }, }, + data() { + return { + isLoading: false, + } + }, + computed: { ...mapState({ currentUser: (state) => state.acl.currentUser, @@ -51,6 +57,7 @@ export default { && this.isValidUser && !this.isPollClosed && !this.option.locked + && !this.isLoading }, isActive() { @@ -94,6 +101,7 @@ export default { methods: { async setVote() { + this.isLoading = true try { await this.$store.dispatch('votes/set', { option: this.option, @@ -104,6 +112,8 @@ export default { } catch (e) { showError(t('polls', 'Error saving vote')) + } finally { + this.isLoading = false } }, },