fix: remove from trending page and hide if watch history is diabled

remove the button from trending page because it only works in feed page.
This commit is contained in:
HiImKobeAnd 2024-08-04 11:53:22 +02:00
parent 095cd1869f
commit ab2f6839e1

View File

@ -122,8 +122,11 @@
>
<i class="i-fa6-solid:circle-minus" />
</button>
<!-- TODO hide watchButton if history is disabled -->
<button ref="watchButton" @click="toggleWatched(item.url.substr(-11))">
<button
v-if="showMarkOnWatched && isFeed"
ref="watchButton"
@click="toggleWatched(item.url.substr(-11))"
>
<i v-if="item.watched" :title="$t('actions.mark_as_unwatched')" class="i-fa6-solid:eye-slash" />
<i v-else :title="$t('actions.mark_as_watched')" class="i-fa6-solid:eye" />
</button>
@ -183,6 +186,7 @@ export default {
showShareModal: false,
showVideo: true,
showConfirmRemove: false,
showMarkOnWatched: false,
};
},
computed: {
@ -195,6 +199,7 @@ export default {
},
mounted() {
this.shouldShowVideo();
this.shouldShowMarkOnWatched();
},
methods: {
removeVideo() {
@ -217,6 +222,9 @@ export default {
}
};
},
shouldShowMarkOnWatched() {
this.showMarkOnWatched = this.getPreferenceBoolean("watchHistory", false);
},
toggleWatched(videoId) {
if (window.db) {
// Should match WatchVideo.vue