Fixed display points for the stat save button (#10522)

This commit is contained in:
Keith Holliday
2018-07-19 22:03:43 -05:00
committed by GitHub
parent f31a82c8f2
commit 8d9a4e97a8

View File

@@ -144,7 +144,7 @@
.up(v-if='user.stats.points', @click='allocate(stat)') .up(v-if='user.stats.points', @click='allocate(stat)')
div div
.down(@click='deallocate(stat)', v-if='user.stats.points') .down(@click='deallocate(stat)', v-if='user.stats.points')
.row.save-row .row.save-row(v-if='showStatsSave')
.col-12.col-md-6.offset-md-3.text-center .col-12.col-md-6.offset-md-3.text-center
button.btn.btn-primary(@click='saveAttributes()', :disabled='loading') {{ this.loading ? $t('loading') : $t('save') }} button.btn.btn-primary(@click='saveAttributes()', :disabled='loading') {{ this.loading ? $t('loading') : $t('save') }}
</template> </template>
@@ -238,6 +238,10 @@
userLevel100Plus () { userLevel100Plus () {
return this.user.stats.lvl >= 100; return this.user.stats.lvl >= 100;
}, },
showStatsSave () {
const statsAreBeingUpdated = Object.values(this.statUpdates).find(stat => stat > 0);
return Boolean(this.user.stats.points) || statsAreBeingUpdated;
},
}, },
methods: { methods: {
getGearTitle (key) { getGearTitle (key) {