Add button to clear history.

Closes #584
This commit is contained in:
FireMaskterK 2021-10-31 18:36:21 +00:00
parent 1c03633c62
commit f1e4380582
No known key found for this signature in database
GPG Key ID: 49451E4482CC5BCD
2 changed files with 14 additions and 1 deletions

View File

@ -1,6 +1,10 @@
<template> <template>
<h1 class="uk-text-bold uk-text-center">{{ $t("titles.history") }}</h1> <h1 class="uk-text-bold uk-text-center">{{ $t("titles.history") }}</h1>
<div style="text-align: left">
<button class="uk-button" v-t="'actions.clear_history'" @click="clearHistory"></button>
</div>
<div style="text-align: right"> <div style="text-align: right">
<label for="ddlSortBy">{{ $t("actions.sort_by") }}</label> <label for="ddlSortBy">{{ $t("actions.sort_by") }}</label>
<select id="ddlSortBy" v-model="selectedSort" class="uk-select uk-width-auto" @change="onChange()"> <select id="ddlSortBy" v-model="selectedSort" class="uk-select uk-width-auto" @change="onChange()">
@ -86,6 +90,14 @@ export default {
break; break;
} }
}, },
clearHistory() {
if (window.db) {
var tx = window.db.transaction("watch_history", "readwrite");
var store = tx.objectStore("watch_history");
store.clear();
}
this.videos = [];
},
}, },
}; };
</script> </script>

View File

@ -64,7 +64,8 @@
"view_ssl_score": "View SSL Score", "view_ssl_score": "View SSL Score",
"search": "Search", "search": "Search",
"filter": "Filter", "filter": "Filter",
"loading": "Loading..." "loading": "Loading...",
"clear_history": "Clear History"
}, },
"comment": { "comment": {
"pinned_by": "Pinned by" "pinned_by": "Pinned by"