fix: redirect to unresolved page after setup if needed
After initial setup completes, the loading page now checks for unresolved folders before showing completion. If any unresolved exist, redirects to /setup/unresolved so users can manually resolve provider keys. Without this fix, users with unresolved folders only saw the loading screen with no way to access the unresolved page.
This commit is contained in:
@@ -468,12 +468,43 @@
|
|||||||
|
|
||||||
function showCompletion() {
|
function showCompletion() {
|
||||||
isComplete = true;
|
isComplete = true;
|
||||||
document.getElementById('completionMessage').style.display = 'block';
|
|
||||||
document.getElementById('connectionStatus').style.display = 'none';
|
document.getElementById('connectionStatus').style.display = 'none';
|
||||||
|
|
||||||
if (ws) {
|
if (ws) {
|
||||||
ws.close();
|
ws.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check for unresolved folders before showing completion
|
||||||
|
checkUnresolvedAndProceed();
|
||||||
|
}
|
||||||
|
|
||||||
|
async function checkUnresolvedAndProceed() {
|
||||||
|
try {
|
||||||
|
const token = localStorage.getItem('auth_token');
|
||||||
|
if (!token) {
|
||||||
|
// No token, go to login
|
||||||
|
document.getElementById('completionMessage').style.display = 'block';
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const res = await fetch('/api/setup/unresolved', {
|
||||||
|
headers: { 'Authorization': `Bearer ${token}` }
|
||||||
|
});
|
||||||
|
|
||||||
|
if (res.ok) {
|
||||||
|
const unresolved = await res.json();
|
||||||
|
if (unresolved && unresolved.length > 0) {
|
||||||
|
// Has unresolved folders - redirect to unresolved page
|
||||||
|
window.location.href = '/setup/unresolved';
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
console.error('Error checking unresolved folders:', e);
|
||||||
|
}
|
||||||
|
|
||||||
|
// No unresolved folders or error - show completion message
|
||||||
|
document.getElementById('completionMessage').style.display = 'block';
|
||||||
}
|
}
|
||||||
|
|
||||||
function showError(message) {
|
function showError(message) {
|
||||||
|
|||||||
Reference in New Issue
Block a user