fix: Infinite Loop on Transaction List

This commit is contained in:
Moriz Wahl 2021-07-08 17:45:38 +02:00
parent 3dd10b3a30
commit 7071a08081

View File

@ -56,42 +56,30 @@
</div> </div>
</template> </template>
<script> <script>
export default { export default {
name: 'DecayInformation', name: 'DecayInformation',
props: { props: {
decay: { decay: {
balance: '', balance: '',
decay_duration: '', decay_duration: '',
decay_start: 0, decay_start: 0,
decay_end: 0, decay_end: 0,
decay_start_block: 0, decay_start_block: 0,
}, },
decaytyp: { type: String, default: '' }, decaytyp: { type: String, default: '' },
}, },
data() { computed: {
return { decayStartBlockTextShort() {
a: 0, return this.decay.decay_start_block
b: 0, ? ' - Startblock Decay am: ' + this.$d(this.$moment.unix(this.decay.decay_start_block))
duration: {}, : ''
diff: {}, },
} getDuration() {
}, const startDate = new Date(this.decay.decay_start)
computed: { const endDate = new Date(this.decay.decay_end)
decayStartBlockTextShort() { const diff = this.$moment.duration(startDate.diff(endDate))
return this.decay.decay_start_block return diff._data
? ' - Startblock Decay am: ' + this.$d(this.$moment.unix(this.decay.decay_start_block)) },
: '' },
}, }
},
methods: {
getDuration(start, end) {
this.a = new Date(start)
this.b = new Date(end)
this.a = this.$moment.unix(this.a)
this.b = this.$moment.unix(this.b)
this.diff = this.$moment.duration(this.a.diff(this.b))
this.duration = this.diff._data
},
},
}
</script> </script>