From 9be9aada137f1506c9038e31dad844a50de1167a Mon Sep 17 00:00:00 2001 From: FireMaskterK <20838718+FireMasterK@users.noreply.github.com> Date: Wed, 27 Oct 2021 01:34:57 +0100 Subject: [PATCH] Fix for errors reading undefined. --- src/components/Player.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/Player.vue b/src/components/Player.vue index 1316465c..40ca7dd0 100644 --- a/src/components/Player.vue +++ b/src/components/Player.vue @@ -142,7 +142,7 @@ export default { if (this.$route.query.t) { videoEl.currentTime = this.$route.query.t; - } else { + } else if (window.db) { var tx = window.db.transaction("watch_history", "readonly"); var store = tx.objectStore("watch_history"); var request = store.get(this.videoId); @@ -359,7 +359,7 @@ export default { if (new Date().getTime() - this.lastUpdate < 500) return; this.lastUpdate = new Date().getTime(); - if (!this.videoId) return; + if (!this.videoId || !window.db) return; var tx = window.db.transaction("watch_history", "readwrite"); var store = tx.objectStore("watch_history");