From dfc56dfee25a178e757f5d0b9d0d111a43083eab Mon Sep 17 00:00:00 2001
From: taehoon
Date: Wed, 20 Mar 2019 12:22:56 -0400
Subject: [PATCH] reset modal state if api request is completed
---
.../user_reporting_modal/user_reporting_modal.js | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/src/components/user_reporting_modal/user_reporting_modal.js b/src/components/user_reporting_modal/user_reporting_modal.js
index ac5b5192..6b1177b9 100644
--- a/src/components/user_reporting_modal/user_reporting_modal.js
+++ b/src/components/user_reporting_modal/user_reporting_modal.js
@@ -36,15 +36,16 @@ const UserReportingModal = {
}
},
watch: {
- userId (value) {
+ userId: 'resetState'
+ },
+ methods: {
+ resetState () {
// Reset state
this.comment = ''
this.forward = false
this.statusIdsToReport = []
this.processing = false
- }
- },
- methods: {
+ },
closeModal () {
this.$store.dispatch('closeUserReportingModal')
},
@@ -59,6 +60,7 @@ const UserReportingModal = {
this.$store.state.api.backendInteractor.reportUser(params)
.then(() => {
this.processing = false
+ this.resetState()
this.closeModal()
})
},