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