From 383e91cfe9f7c85d6bf307d8fba6313d9ff12596 Mon Sep 17 00:00:00 2001 From: Kenny <27463495+Frontesque@users.noreply.github.com> Date: Wed, 10 Aug 2022 15:44:07 -0400 Subject: [PATCH] perf: :zap: make watch page use less RAM --- NUXT/components/Player/watchtime.vue | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/NUXT/components/Player/watchtime.vue b/NUXT/components/Player/watchtime.vue index 9517500..6d7e557 100644 --- a/NUXT/components/Player/watchtime.vue +++ b/NUXT/components/Player/watchtime.vue @@ -22,20 +22,15 @@ export default { humanDuration: 0, } }, - methods: { - calcDuration() { - this.humanDuration = this.$vuetube.humanTime(this.duration); - } - }, mounted() { - //--- Only call 'calcDuration()' when 'this.duration' becomes defined ---// + //--- Only set video duration when 'this.duration' becomes defined ---// const durationTimer = setInterval(() => { if (this.duration) { - this.calcDuration(); + this.humanDuration = this.$vuetube.humanTime(this.duration); return clearInterval(durationTimer); } }, 100); - //--- END Only call 'calcDuration()' when 'this.duration' becomes defined ---// + //--- END Only set video duration when 'this.duration' becomes defined ---// } };