fix: reuse existing variable

This commit is contained in:
Alex Maras 2022-06-25 23:58:55 +08:00
parent 26348ccc74
commit e837e5f780

View File

@ -146,7 +146,7 @@ export default {
const baseTime = this.useChapterTrack ? this.currentChapterStart : 0; const baseTime = this.useChapterTrack ? this.currentChapterStart : 0;
const duration = this.useChapterTrack ? this.currentChapterDuration : this.duration; const duration = this.useChapterTrack ? this.currentChapterDuration : this.duration;
const chapterTime = (offsetX / this.trackWidth) * duration; const chapterTime = (offsetX / this.trackWidth) * duration;
const totalTime = baseTime + ((offsetX / this.trackWidth) * duration); const totalTime = baseTime + chapterTime;
if (this.$refs.hoverTimestamp) { if (this.$refs.hoverTimestamp) {
var width = this.$refs.hoverTimestamp.clientWidth var width = this.$refs.hoverTimestamp.clientWidth