Spaces:
Sleeping
Sleeping
Nathan commited on
Commit ·
93ce8de
1
Parent(s): df9cf4e
Debug: Add on-screen diagnostics for YouTube connection
Browse filesFiles changed (2)
- dashboard/index.html+12-7
- server.js+6-1
387 unmodified lines388389390391392393394395396397398399400387 unmodified linesconst list = document.getElementById('channel-list');list.innerHTML = '';if (yt.error) {console.error("YouTube Error:", yt.error);const errDiv = document.createElement('div');errDiv.style.cssText = "color: var(--danger); font-size: 0.8rem; margin-bottom: 15px; text-align: center; background: rgba(239, 68, 68, 0.1); padding: 10px; border-radius: 12px; border: 1px solid var(--danger);";errDiv.innerHTML = `<i data-lucide="alert-circle" style="width: 14px; vertical-align: middle;"></i> ${yt.error}`;list.appendChild(errDiv);}if (yt.connected && yt.channels && yt.channels.length > 0) {document.getElementById('yt-active-group').style.display = 'block';387 unmodified lines388389390391392393394395396397398399400401402403404405387 unmodified linesconst list = document.getElementById('channel-list');list.innerHTML = '';// DEBUG INFO (Only visible if something is wrong)const debugPanel = document.getElementById('debug-info') || document.createElement('div');debugPanel.id = 'debug-info';debugPanel.style.cssText = "font-size: 0.7rem; color: var(--text-dim); margin-top: 10px; padding: 10px; background: rgba(0,0,0,0.2); border-radius: 10px; border: 1px solid var(--glass-border);";debugPanel.innerHTML = `<div style="display:flex; justify-content:space-between;"><span>Database Channels: ${yt.channels?.length || 0}</span><span>API Connected: ${yt.connected ? 'YES' : 'NO'}</span></div>${yt.error ? `<div style="color:var(--danger); margin-top:5px;">Error: ${yt.error}</div>` : ''}`;list.parentElement.appendChild(debugPanel);if (yt.connected && yt.channels && yt.channels.length > 0) {document.getElementById('yt-active-group').style.display = 'block';
386 unmodified lines387388389390391392393386 unmodified lines});} catch (error) {console.error("🔥 [API/YouTube] Critical Error:", error.message);res.json({ connected: false, channels: [], error: error.message });}});386 unmodified lines387388389390391392393394395396397398386 unmodified lines});} catch (error) {console.error("🔥 [API/YouTube] Critical Error:", error.message);const { data: rawChannels } = await db.from('channels').select('id').eq('user_id', req.userId);res.json({connected: false,channels: rawChannels || [],error: error.message});}});
dashboard/index.html+12-7
server.js+6-1