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>
<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">
<label for="ddlSortBy">{{ $t("actions.sort_by") }}</label>
<select id="ddlSortBy" v-model="selectedSort" class="uk-select uk-width-auto" @change="onChange()">
@ -86,6 +90,14 @@ export default {
break;
}
},
clearHistory() {
if (window.db) {
var tx = window.db.transaction("watch_history", "readwrite");
var store = tx.objectStore("watch_history");
store.clear();
}
this.videos = [];
},
},
};
</script>

View file

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