Cloned correctly (#9084)

Fixed cloning values during fix custom values
This commit is contained in:
Keith Holliday
2017-09-26 23:02:58 -05:00
committed by GitHub
parent 08323f307c
commit 526d0b1a23

View File

@@ -47,6 +47,7 @@
</template> </template>
<script> <script>
import clone from 'lodash/clone';
import { mapState } from 'client/libs/store'; import { mapState } from 'client/libs/store';
import bModal from 'bootstrap-vue/lib/components/modal'; import bModal from 'bootstrap-vue/lib/components/modal';
@@ -72,8 +73,8 @@ export default {
}; };
}, },
mounted () { mounted () {
Object.assign(this.restoreValues.stats, this.user.stats); this.restoreValues.stats = clone(this.user.stats);
Object.assign(this.restoreValues.achievements.streak, this.user.achievements.streak); this.restoreValues.achievements.streak = clone(this.user.achievements.streak);
}, },
computed: { computed: {
...mapState({user: 'user.data'}), ...mapState({user: 'user.data'}),
@@ -89,8 +90,8 @@ export default {
return; return;
} }
this.user.stats = this.restoreValues.stats; this.user.stats = clone(this.restoreValues.stats);
this.user.achievements.streak = this.restoreValues.achievements.streak; this.user.achievements.streak = clone(this.restoreValues.achievements.streak);
let settings = { let settings = {
'stats.hp': this.restoreValues.stats.hp, 'stats.hp': this.restoreValues.stats.hp,