fix: title link wired via JS goHome() — switches to downloads, closes status, resets showAll
All checks were successful
Build and Push Docker Image / build (push) Successful in 40s
CI / Security audit (push) Successful in 1m33s
CI / Tests & coverage (push) Successful in 1m56s

This commit is contained in:
2026-05-17 23:08:27 +01:00
parent 57b127ea95
commit a92ab85bc0
2 changed files with 14 additions and 1 deletions

View File

@@ -35,6 +35,7 @@ document.addEventListener('DOMContentLoaded', () => {
document.getElementById('logout-btn').addEventListener('click', handleLogout);
document.getElementById('show-all-toggle').addEventListener('change', handleShowAllToggle);
document.getElementById('status-btn').addEventListener('click', toggleStatusPanel);
document.getElementById('title-home-link').addEventListener('click', e => { e.preventDefault(); goHome(); });
});
function loadAppVersion() {
@@ -64,6 +65,18 @@ function setTheme(theme) {
});
}
function goHome() {
closeStatusPanel();
// Reset showAll if active
if (showAll) {
showAll = false;
const toggle = document.getElementById('show-all-toggle');
if (toggle) toggle.checked = false;
startSSE();
}
activateTab('downloads', true);
}
function initTabs() {
const savedTab = localStorage.getItem('sofarr-active-tab') || 'downloads';
activateTab(savedTab, false);

View File

@@ -46,7 +46,7 @@
<!-- Dashboard -->
<div id="dashboard-container" class="dashboard-container" style="display: none;">
<header class="app-header">
<h1><a href="#" class="title-link" onclick="activateTab('downloads',true);closeStatusPanel();return false;"><img src="favicon-192.png" alt="" class="title-logo">sofarr</a></h1>
<h1><a href="#" class="title-link" id="title-home-link"><img src="favicon-192.png" alt="" class="title-logo">sofarr</a></h1>
<div class="header-controls">
<div class="theme-switcher">
<button class="theme-btn active" data-theme="light">Light</button>