mirror of
https://github.com/ranaldsgift/KefinTweaks.git
synced 2026-11-05 15:52:47 +01:00
Fix hardcoded watchlist tab for custom menu link
This commit is contained in:
+11
-16
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user