Fix hardcoded watchlist tab for custom menu link

This commit is contained in:
HighImKevin
2025-10-22 06:44:05 -04:00
parent bc20cc0b70
commit 17991fa5ec
+11 -16
View File
@@ -2938,21 +2938,23 @@ In the Custom Tabs plugin, add a new tab with the following HTML content:
watchlistSection.dataset.htmlRendered = 'true';
// Reset listeners setup flag since we have new DOM elements
watchlistSection.dataset.listenersSetup = 'false';
const watchlistTabIndex = document.querySelector('.libraryPage:not(.hide) .pageTabContent:has(.sections.watchlist)')?.getAttribute("data-index");
if (watchlistTabIndex) {
window.KefinTweaksUtils.addCustomMenuLink(
'Watchlist',
'bookmark',
'#/home.html?tab=' + watchlistTabIndex
);
}
// Add refresh buttons after HTML is rendered
addRefreshButtons();
LOG('Watchlist HTML structure rendered successfully');
}
// Clear watchlist cache
function clearWatchlistCache() {
Object.keys(watchlistCache).forEach(section => {
watchlistCache[section].data = [];
});
LOG('Watchlist cache cleared');
}
// Update watchlist cache when an item is toggled
async function updateWatchlistCacheOnToggle(itemId, itemType, isAdded) {
try {
@@ -5463,13 +5465,6 @@ In the Custom Tabs plugin, add a new tab with the following HTML content:
// Initialize the observer
setupWatchlistButtonObserver();
// Add watchlist to custom menu
window.KefinTweaksUtils.addCustomMenuLink(
'Watchlist',
'bookmark',
'#/home.html?tab=2'
);
/************ Item Detail Page Observer ************/
// Function to add watchlist button to item detail page