feat(setup): redirect to /loading instead of / after setup flow

- loading.html: check for unresolved folders before redirecting, go to /login if none
- unresolved.html: redirect to /loading instead of / after skip/timeout
- add docs/NAVIGATION.md navigation flow documentation
This commit is contained in:
2026-06-06 22:46:02 +02:00
parent 8bb8c6aa64
commit d22df947e4
3 changed files with 196 additions and 5 deletions

View File

@@ -475,9 +475,26 @@
}
async function checkUnresolvedAndProceed() {
// Always redirect to /setup/unresolved after initialization
// so users can manually enter unresolved animes
window.location.href = '/setup/unresolved';
// Fetch unresolved folders and only redirect if there are any
// Otherwise go directly to login
try {
const token = localStorage.getItem('auth_token');
const res = await fetch('/api/setup/unresolved', {
headers: { 'Authorization': `Bearer ${token}` }
});
if (res.ok) {
const folders = await res.json();
if (folders && folders.length > 0) {
// Has unresolved folders - go to resolution page
window.location.href = '/setup/unresolved';
return;
}
}
} catch (err) {
console.error('Failed to check unresolved folders:', err);
}
// No unresolved folders or error - go to login
window.location.href = '/login';
}
function showError(message) {

View File

@@ -552,7 +552,7 @@
listEl.style.display = 'none';
emptyEl.style.display = 'block';
document.getElementById('skip-link').style.display = 'block';
setTimeout(() => { window.location.href = '/'; }, 2000);
setTimeout(() => { window.location.href = '/loading'; }, 2000);
} else {
listEl.style.display = 'flex';
emptyEl.style.display = 'none';
@@ -690,7 +690,7 @@
emptyEl.style.display = 'block';
skipLink.style.display = 'block';
showToast('All series configured!', 'success');
setTimeout(() => { window.location.href = '/'; }, 2000);
setTimeout(() => { window.location.href = '/loading'; }, 2000);
}
}