Only enable page bookmarking on certain routes

This commit is contained in:
Jason Henriquez 2024-10-27 21:53:47 -05:00
parent a2914fa6ff
commit e9b539face
4 changed files with 15 additions and 3 deletions

View File

@ -34,11 +34,20 @@ export default defineComponent({
}
return {
isRouteBookmarkable: false,
showSearchContainer: true,
isArrowBackwardDisabled,
isArrowForwardDisabled,
currentRouteFullPath: '',
searchSuggestionsDataList: [],
allowedPageBookmarkRouteMetaTitles: [
'Search Results',
'Playlist',
'Channel',
'Watch',
'Hashtag',
'Settings' // for linkable settings sections
],
lastSuggestionQuery: ''
}
},
@ -129,6 +138,7 @@ export default defineComponent({
}
this.currentRouteFullPath = to.fullPath
this.isRouteBookmarkable = this.allowedPageBookmarkRouteMetaTitles.includes(to.meta.title)
}
},
mounted: function () {

View File

@ -60,7 +60,8 @@
}
&.arrowBackwardDisabled,
&.arrowForwardDisabled {
&.arrowForwardDisabled,
&.disabled {
color: #808080;
opacity: 0.5;
pointer-events: none;

View File

@ -107,8 +107,8 @@
:icon="['fas', 'star']"
:title="pageBookmarkIconTitle"
:active="isPageBookmarked"
:class="{ [pageBookmarkIconTheme]: true }"
:disabled="!pageBookmarksAvailable"
:class="{ [pageBookmarkIconTheme]: true, disabled: !pageBookmarksAvailable || !isRouteBookmarkable }"
:aria-disabled="!pageBookmarksAvailable || !isRouteBookmarkable"
role="button"
tabindex="0"
@click="showPageBookmarkPrompt"

View File

@ -1123,6 +1123,7 @@ Page Bookmark:
Updated page bookmark: Updated page bookmark "{name}"
Removed page bookmark: Removed page bookmark "{name}"
There is {count} other bookmark with the same name.: There is {count} other page bookmark with the same name. | There are {count} other page bookmarks with the same name.
This page cannot be bookmarked.: This page cannot be bookmarked.
Role Descriptions:
bookmark: bookmark
Moments Ago: moments ago