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