Upload 5 modified files from chat-switchboard-v0.5.1-2.zip

This commit is contained in:
2026-02-18 21:40:06 +00:00
parent 410492a7fa
commit a6b55a0352
3 changed files with 14 additions and 8 deletions

View File

@@ -43,8 +43,14 @@ async function init() {
await API.getProfile();
console.log('✅ Session valid for', API.user?.username);
} catch (e) {
console.warn('⚠️ Session expired, clearing');
API.clearTokens();
if (e.status === 401) {
console.warn('⚠️ Session expired, clearing');
API.clearTokens();
} else {
// 404 = profile not created yet, other errors = transient
// Token is still valid, proceed
console.log(' Profile fetch returned', e.status || e.message, '— session OK');
}
}
}