diff options
| author | taehoon <th.dev91@gmail.com> | 2019-03-20 12:22:56 -0400 |
|---|---|---|
| committer | taehoon <th.dev91@gmail.com> | 2019-05-03 11:40:05 -0400 |
| commit | dfc56dfee25a178e757f5d0b9d0d111a43083eab (patch) | |
| tree | e0abab24c831985466f2ceaa84e66d2a5e29028a | |
| parent | 1b07c6ae4f0d06e25b124bba2f088d3a02f78ecc (diff) | |
reset modal state if api request is completed
| -rw-r--r-- | src/components/user_reporting_modal/user_reporting_modal.js | 10 |
1 files 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() }) }, |
