deployed count

This commit is contained in:
Danil Kovtonyuk 2020-11-03 23:13:09 +10:00
parent 70c5487ba2
commit b41e441395
2 changed files with 14 additions and 2 deletions

View File

@ -16,7 +16,7 @@
<i18n tag="h3" class="title is-14px mt-6" path="completedTasks"> <i18n tag="h3" class="title is-14px mt-6" path="completedTasks">
<template v-slot:progress> <template v-slot:progress>
<span>5/16</span> <span>{{ deployedCount }}</span>
</template> </template>
</i18n> </i18n>
@ -28,11 +28,15 @@
<script> <script>
import Steps from '@/components/Steps' import Steps from '@/components/Steps'
import { mapGetters } from 'vuex'
export default { export default {
components: { components: {
Steps, Steps,
}, },
computed: {
...mapGetters('steps', ['deployedCount']),
},
methods: { methods: {
scrollTo(element) { scrollTo(element) {
window.scrollTo({ window.scrollTo({

View File

@ -92,7 +92,15 @@ const state = () => {
} }
} }
const getters = {} const getters = {
deployedCount: (state) => {
const deployed = state.steps.filter((step) => {
return !!step.deployerAddress
}).length
const all = state.steps.length
return `${deployed}/${all}`
},
}
const SET_DEPLOYER = 'SET_DEPLOYER' const SET_DEPLOYER = 'SET_DEPLOYER'
const mutations = { const mutations = {