From ed45cba4c3a10c64e8b491af48698d30a39a5a88 Mon Sep 17 00:00:00 2001 From: Chris Hallberg Date: Mon, 17 Oct 2022 19:44:32 -0400 Subject: [PATCH 1/9] Add watched/unwatched button. - Separate watchHistory and hideWatched preferences. - Create db when hideWatched is on but watchHistory is off. - Add english translations. --- src/App.vue | 7 +++- src/components/PreferencesPage.vue | 2 +- src/components/VideoItem.vue | 59 +++++++++++++++++++++++++++++- src/locales/en.json | 4 +- 4 files changed, 67 insertions(+), 5 deletions(-) diff --git a/src/App.vue b/src/App.vue index c5dce7a2..8346bd15 100644 --- a/src/App.vue +++ b/src/App.vue @@ -40,7 +40,7 @@ export default { darkModePreference.addEventListener("change", () => { this.setTheme(); }); - if (this.getPreferenceBoolean("watchHistory", false)) + if (this.getPreferenceBoolean("watchHistory", false) || this.getPreferenceBoolean("hideWatched", false)) { if ("indexedDB" in window) { const request = indexedDB.open("piped-db", 1); request.onupgradeneeded = function () { @@ -55,7 +55,10 @@ export default { request.onsuccess = e => { window.db = e.target.result; }; - } else console.log("This browser doesn't support IndexedDB"); + } else { + console.log("This browser doesn't support IndexedDB"); + } + } const App = this; diff --git a/src/components/PreferencesPage.vue b/src/components/PreferencesPage.vue index 3a857369..c2dee8d6 100644 --- a/src/components/PreferencesPage.vue +++ b/src/components/PreferencesPage.vue @@ -116,7 +116,7 @@ @change="onChange($event)" /> -