This commit is contained in:
2025-06-10 12:26:50 +02:00
parent b332f913a6
commit 4d55bb63b2
2 changed files with 57 additions and 4 deletions

View File

@@ -133,7 +133,8 @@ const testConnection = async () => {
imapHost: credentials.value.imapHost || undefined,
smtpHost: credentials.value.smtpHost || undefined,
sessionId: getSessionId()
}
},
timeout: 15000 // 15 second timeout
});
if (response.success) {
@@ -144,7 +145,29 @@ const testConnection = async () => {
}
} catch (error: any) {
console.error('Connection test failed:', error);
toast.error(error.data?.statusMessage || 'Failed to connect to email server');
// If it's a timeout error, offer to proceed anyway
if (error.message?.includes('timeout') || error.statusCode === 504) {
const proceed = confirm('Connection test timed out, but the email system might still work. Would you like to proceed anyway?');
if (proceed) {
// Store credentials anyway
toast.info('Proceeding with email setup...');
sessionStorage.setItem('connectedEmail', credentials.value.email);
// Manually store encrypted credentials
try {
// Generate a session ID if not already present
const sessionId = getSessionId();
// We'll trust that the credentials are correct and proceed
emit('connected', credentials.value.email);
} catch (e) {
console.error('Failed to store credentials:', e);
}
}
} else {
toast.error(error.data?.statusMessage || 'Failed to connect to email server');
}
} finally {
testing.value = false;
}