From a6b55a03524d9cbaa0b1236622b6afbc24ede2d6 Mon Sep 17 00:00:00 2001 From: xcaliber Date: Wed, 18 Feb 2026 21:40:06 +0000 Subject: [PATCH] Upload 5 modified files from chat-switchboard-v0.5.1-2.zip --- src/index.html | 10 +++++----- src/js/app.js | 10 ++++++++-- src/js/debug.js | 2 +- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/src/index.html b/src/index.html index 994390a..c414102 100644 --- a/src/index.html +++ b/src/index.html @@ -7,7 +7,7 @@ - + @@ -305,9 +305,9 @@ onerror="this.onerror=null; this.src='https://cdnjs.cloudflare.com/ajax/libs/dompurify/3.2.4/purify.min.js'"> - - - - + + + + diff --git a/src/js/app.js b/src/js/app.js index 668f1d1..08c4c9c 100644 --- a/src/js/app.js +++ b/src/js/app.js @@ -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'); + } } } diff --git a/src/js/debug.js b/src/js/debug.js index a34def8..ff4e2f4 100644 --- a/src/js/debug.js +++ b/src/js/debug.js @@ -330,7 +330,7 @@ const DebugLog = { badge.innerHTML = '🐛'; badge.title = 'Debug Log (Ctrl+Shift+L)'; badge.style.cssText = ` - position: fixed; bottom: 12px; right: 12px; z-index: 100000; + position: fixed; bottom: 12px; left: 12px; z-index: 100000; width: 36px; height: 36px; border-radius: 50%; background: var(--bg-secondary, #2a2a2a); border: 1px solid var(--border, #444); display: flex; align-items: center; justify-content: center;