Fix for errors reading undefined.

This commit is contained in:
FireMaskterK 2021-10-27 01:34:57 +01:00
parent 993fb15397
commit 9be9aada13
No known key found for this signature in database
GPG key ID: 49451E4482CC5BCD

View file

@ -142,7 +142,7 @@ export default {
if (this.$route.query.t) { if (this.$route.query.t) {
videoEl.currentTime = this.$route.query.t; videoEl.currentTime = this.$route.query.t;
} else { } else if (window.db) {
var tx = window.db.transaction("watch_history", "readonly"); var tx = window.db.transaction("watch_history", "readonly");
var store = tx.objectStore("watch_history"); var store = tx.objectStore("watch_history");
var request = store.get(this.videoId); var request = store.get(this.videoId);
@ -359,7 +359,7 @@ export default {
if (new Date().getTime() - this.lastUpdate < 500) return; if (new Date().getTime() - this.lastUpdate < 500) return;
this.lastUpdate = new Date().getTime(); this.lastUpdate = new Date().getTime();
if (!this.videoId) return; if (!this.videoId || !window.db) return;
var tx = window.db.transaction("watch_history", "readwrite"); var tx = window.db.transaction("watch_history", "readwrite");
var store = tx.objectStore("watch_history"); var store = tx.objectStore("watch_history");