From 72755180625b2f841b0b9ce575b685da3c69ff5e Mon Sep 17 00:00:00 2001 From: ogerly Date: Wed, 7 Dec 2022 09:56:46 +0100 Subject: [PATCH] hideAmounts in store for GDD and GDD --- .../components/Template/ContentHeader/GddAmount.vue | 11 ++++++----- .../components/Template/ContentHeader/GdtAmount.vue | 10 +++++----- frontend/src/store/store.js | 12 ++++++++++++ 3 files changed, 23 insertions(+), 10 deletions(-) diff --git a/frontend/src/components/Template/ContentHeader/GddAmount.vue b/frontend/src/components/Template/ContentHeader/GddAmount.vue index 9ac91dc7d..55d698785 100644 --- a/frontend/src/components/Template/ContentHeader/GddAmount.vue +++ b/frontend/src/components/Template/ContentHeader/GddAmount.vue @@ -28,10 +28,11 @@ --> -
+
{{ $t('asterisks') }} @@ -52,10 +53,10 @@ export default { badge: { type: Boolean, default: false }, showStatus: { type: Boolean, default: false }, }, - data() { - return { - hideAmount: true, - } + computed: { + hideAmount() { + return this.$store.state.hideAmountGDD + }, }, } diff --git a/frontend/src/components/Template/ContentHeader/GdtAmount.vue b/frontend/src/components/Template/ContentHeader/GdtAmount.vue index 276393f54..c55f1d363 100644 --- a/frontend/src/components/Template/ContentHeader/GdtAmount.vue +++ b/frontend/src/components/Template/ContentHeader/GdtAmount.vue @@ -29,7 +29,7 @@ {{ $t('asterisks') }} @@ -49,10 +49,10 @@ export default { badge: { type: Boolean, default: false }, showStatus: { type: Boolean, default: false }, }, - data() { - return { - hideAmount: true, - } + computed: { + hideAmount() { + return this.$store.state.hideAmountGDT + }, }, } diff --git a/frontend/src/store/store.js b/frontend/src/store/store.js index 8fdbc519e..25162ea0e 100644 --- a/frontend/src/store/store.js +++ b/frontend/src/store/store.js @@ -50,6 +50,12 @@ export const mutations = { creation: (state, creation) => { state.creation = creation }, + hideAmountGDD: (state, hideAmountGDD) => { + state.hideAmountGDD = hideAmountGDD + }, + hideAmountGDT: (state, hideAmountGDT) => { + state.hideAmountGDT = hideAmountGDT + }, } export const actions = { @@ -64,6 +70,8 @@ export const actions = { commit('publisherId', data.publisherId) commit('isAdmin', data.isAdmin) commit('creation', data.creation) + commit('hideAmountGDD', data.hideAmountGDD) + commit('hideAmountGDT', data.hideAmountGDT) }, logout: ({ commit, state }) => { commit('token', null) @@ -76,6 +84,8 @@ export const actions = { commit('publisherId', null) commit('isAdmin', false) commit('creation', null) + commit('hideAmountGDD', true) + commit('hideAmountGDT', true) localStorage.clear() }, } @@ -102,6 +112,8 @@ try { hasElopage: false, publisherId: null, creation: null, + hideAmountGDD: true, + hideAmountGDT: true, }, getters: {}, // Syncronous mutation of the state