Refresh the relative time object for a Timeago component if the time changes

remove-mods-files
Sean King 2 years ago
parent 232cc72df8
commit b70d50407c
No known key found for this signature in database
GPG Key ID: 510C52BACD6E7257

@ -34,6 +34,13 @@ export default {
unmounted () {
clearTimeout(this.interval)
},
watch: {
time (newVal, oldVal) {
if (oldVal !== newVal) {
this.refreshRelativeTimeObject()
}
}
},
methods: {
refreshRelativeTimeObject () {
const nowThreshold = typeof this.nowThreshold === 'number' ? this.nowThreshold : 1

Loading…
Cancel
Save