From 9913909cfa235eccb4764de679712c53fa605f5b Mon Sep 17 00:00:00 2001 From: Angelina Filippova Date: Thu, 3 Dec 2020 23:23:20 +0300 Subject: [PATCH] Fix loading single report page --- src/store/modules/reports.js | 8 ++++++-- src/views/reports/show.vue | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/store/modules/reports.js b/src/store/modules/reports.js index c42fa894..2589daa4 100644 --- a/src/store/modules/reports.js +++ b/src/store/modules/reports.js @@ -12,6 +12,7 @@ const reports = { currentPage: 1, fetchedReports: [], loading: true, + loadingSingleReport: true, openReportsCount: 0, pageSize: 50, singleReport: {}, @@ -42,6 +43,9 @@ const reports = { }, SET_SINGLE_REPORT: (state, report) => { state.singleReport = report + }, + SET_SINGLE_REPORT_LOADING: (state, status) => { + state.loadingSingleReport = status } }, actions: { @@ -162,11 +166,11 @@ const reports = { commit('SET_LOADING', false) }, async FetchSingleReport({ commit, getters }, id) { - commit('SET_LOADING', true) + commit('SET_SINGLE_REPORT_LOADING', true) const { data } = await fetchSingleReport(id, getters.authHost, getters.token) commit('SET_SINGLE_REPORT', data) - commit('SET_LOADING', false) + commit('SET_SINGLE_REPORT_LOADING', false) }, async FetchOpenReportsCount({ commit, getters, state }) { commit('SET_LOADING', true) diff --git a/src/views/reports/show.vue b/src/views/reports/show.vue index 5f30f376..8a023b00 100644 --- a/src/views/reports/show.vue +++ b/src/views/reports/show.vue @@ -47,7 +47,7 @@ export default { components: { ModerateUserDropdown, RebootButton, ReportContent }, computed: { loading() { - return this.$store.state.reports.loading + return this.$store.state.reports.loadingSingleReport }, report() { return this.$store.state.reports.singleReport