refactor: comment out unused socket functionality in SoundboardPage component
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { AddUrlDialog } from '@/components/AddUrlDialog'
|
||||
import { Button } from '@/components/ui/button'
|
||||
import { Card, CardContent } from '@/components/ui/card'
|
||||
import { useSocket } from '@/contexts/SocketContext'
|
||||
// import { useSocket } from '@/contexts/SocketContext'
|
||||
import { useAddUrlShortcut } from '@/hooks/use-keyboard-shortcuts'
|
||||
import { useTheme } from '@/hooks/use-theme'
|
||||
import { formatDuration } from '@/lib/format-duration'
|
||||
@@ -106,7 +106,7 @@ export function SoundboardPage() {
|
||||
const [searchTerm, setSearchTerm] = useState('')
|
||||
const [addUrlDialogOpen, setAddUrlDialogOpen] = useState(false)
|
||||
const [currentColors, setCurrentColors] = useState<string[]>(lightModeColors)
|
||||
const { socket, isConnected } = useSocket()
|
||||
// const { socket, isConnected } = useSocket()
|
||||
|
||||
// Setup keyboard shortcut for CTRL+U
|
||||
useAddUrlShortcut(() => setAddUrlDialogOpen(true))
|
||||
@@ -146,11 +146,11 @@ export function SoundboardPage() {
|
||||
|
||||
const handlePlaySound = async (soundId: number) => {
|
||||
try {
|
||||
// Try socket.io first if connected
|
||||
if (socket && isConnected) {
|
||||
socket.emit('play_sound', { soundId })
|
||||
return
|
||||
}
|
||||
// // Try socket.io first if connected
|
||||
// if (socket && isConnected) {
|
||||
// socket.emit('play_sound', { soundId })
|
||||
// return
|
||||
// }
|
||||
|
||||
// Fallback to API request
|
||||
await apiService.post(`/api/soundboard/sounds/${soundId}/play`)
|
||||
|
||||
Reference in New Issue
Block a user