Fix tab selection - use data-tab attribute instead of missing IDs
This commit is contained in:
@@ -4,10 +4,8 @@ import { getActiveTab, saveActiveTab } from '../utils/storage.js';
|
||||
import { loadHistory } from './history.js';
|
||||
|
||||
export function initTabs() {
|
||||
const downloadsTab = document.getElementById('downloads-tab');
|
||||
const historyTab = document.getElementById('history-tab');
|
||||
const downloadsSection = document.getElementById('downloads-section');
|
||||
const historySection = document.getElementById('history-section');
|
||||
const downloadsTab = document.querySelector('[data-tab="downloads"]');
|
||||
const historyTab = document.querySelector('[data-tab="history"]');
|
||||
|
||||
if (!downloadsTab || !historyTab) return;
|
||||
|
||||
@@ -24,8 +22,8 @@ export function initTabs() {
|
||||
}
|
||||
|
||||
export function activateTab(tab) {
|
||||
const downloadsTab = document.getElementById('downloads-tab');
|
||||
const historyTab = document.getElementById('history-tab');
|
||||
const downloadsTab = document.querySelector('[data-tab="downloads"]');
|
||||
const historyTab = document.querySelector('[data-tab="history"]');
|
||||
const downloadsSection = document.getElementById('tab-downloads');
|
||||
const historySection = document.getElementById('tab-history');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user