Revert "perf: make watch page use less RAM"

This reverts commit 383e91cfe9.
This commit is contained in:
Kenny 2022-08-10 16:01:54 -04:00
parent 383e91cfe9
commit 5ff2bcbaa7
1 changed files with 8 additions and 3 deletions

View File

@ -22,15 +22,20 @@ export default {
humanDuration: 0,
}
},
methods: {
calcDuration() {
this.humanDuration = this.$vuetube.humanTime(this.duration);
}
},
mounted() {
//--- Only set video duration when 'this.duration' becomes defined ---//
//--- Only call 'calcDuration()' when 'this.duration' becomes defined ---//
const durationTimer = setInterval(() => {
if (this.duration) {
this.humanDuration = this.$vuetube.humanTime(this.duration);
this.calcDuration();
return clearInterval(durationTimer);
}
}, 100);
//--- END Only set video duration when 'this.duration' becomes defined ---//
//--- END Only call 'calcDuration()' when 'this.duration' becomes defined ---//
}
};
</script>