mirror of
https://github.com/ranaldsgift/KefinTweaks.git
synced 2026-11-05 15:52:47 +01:00
Fixes the issue causing the Watchlist tab to stay present even when Watchlist is disabled
This commit is contained in:
+11
-2
@@ -787,9 +787,18 @@ window.KefinTweaksConfig = ${JSON.stringify(defaultConfig, null, 2)};`;
|
||||
return true;
|
||||
}
|
||||
|
||||
// Check if Watchlist is enabled in the configuration
|
||||
// Check if Watchlist is enabled in the configuration and remove it if not
|
||||
if (!window.KefinTweaksConfig.scripts.watchlist) {
|
||||
console.log('[KefinTweaks Startup] Watchlist is disabled in configuration, skipping Watchlist tab check');
|
||||
console.log('[KefinTweaks Startup] Watchlist is disabled in configuration, removing Watchlist tab');
|
||||
const pluginId = await findPlugin('Custom Tabs');
|
||||
if (!pluginId) {
|
||||
console.warn('[KefinTweaks Startup] CustomTabs plugin not found');
|
||||
return false;
|
||||
}
|
||||
const config = await getPluginConfig(pluginId);
|
||||
const tabs = config.Tabs.filter(tab => tab.Title !== 'Watchlist');
|
||||
await savePluginConfig(pluginId, { Tabs: tabs });
|
||||
console.log('[KefinTweaks Startup] Removed Watchlist tab from CustomTabs');
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user