From 84cdc6fe82ce65c51bd5a57cd77e375af8910e8c Mon Sep 17 00:00:00 2001 From: Scott Register Date: Fri, 12 Dec 2025 23:21:05 -0800 Subject: [PATCH] fix shit --- .gitignore | 3 ++ web/src/components/ConnectionStatus.jsx | 65 +++++++++++++++++++++++-- 2 files changed, 64 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index aaac669..5a1ad64 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ node_modules/ *.log .DS_Store music/ +music/* data/ dist/ build/ @@ -11,6 +12,8 @@ build/ *.swp *.swo *~ +*.mp3 +*.mp4 coverage/ .nyc_output/ tmp/ diff --git a/web/src/components/ConnectionStatus.jsx b/web/src/components/ConnectionStatus.jsx index 2a36ea8..54d7def 100644 --- a/web/src/components/ConnectionStatus.jsx +++ b/web/src/components/ConnectionStatus.jsx @@ -6,6 +6,8 @@ export default function ConnectionStatus() { const [channels, setChannels] = useState([]); const [loading, setLoading] = useState(false); const [disconnecting, setDisconnecting] = useState(false); + const [joining, setJoining] = useState(false); + const [showChannels, setShowChannels] = useState(false); useEffect(() => { loadChannels(); @@ -43,9 +45,29 @@ export default function ConnectionStatus() { } }; + const handleJoin = async (channelId) => { + try { + setJoining(true); + const response = await fetch(`${API_URL}/channels/join`, { + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify({ channelId }) + }); + + if (response.ok) { + loadChannels(); + setShowChannels(false); + } + } catch (error) { + console.error('Failed to join channel:', error); + } finally { + setJoining(false); + } + }; + const currentChannel = channels.find(c => c.current); - if (loading && !currentChannel) { + if (loading && channels.length === 0) { return (
Loading...
@@ -55,9 +77,44 @@ export default function ConnectionStatus() { if (!currentChannel) { return ( -
-
-
Disconnected
+
+
+
+
+
Disconnected
+
+ +
+ + {showChannels && ( +
+
+
Select Channel
+
+ {channels.map(channel => ( + + ))} +
+
+
+ )}
); }