fix(05-jamtrack): get subscribe/unsubscribe methods from context correctly
Issue: "WebSocket connection not available" error Root cause: Getting 'server' object instead of subscribe/unsubscribe methods Fix: Extract subscribe/unsubscribe directly from useJamServerContext() and create jamServer object with those methods for the thunks. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
965dc2d708
commit
be23322acb
|
|
@ -38,7 +38,13 @@ const JKSessionJamTrackPlayer = ({
|
|||
const [selectedMixdownId, setSelectedMixdownId] = useState(initialMixdownId);
|
||||
|
||||
// Context
|
||||
const { server: jamServer } = useJamServerContext();
|
||||
const { subscribe, unsubscribe } = useJamServerContext();
|
||||
|
||||
// Create jamServer object with subscribe/unsubscribe for thunks
|
||||
const jamServer = useMemo(() => ({
|
||||
subscribe,
|
||||
unsubscribe
|
||||
}), [subscribe, unsubscribe]);
|
||||
|
||||
// Redux state
|
||||
const dispatch = useDispatch();
|
||||
|
|
|
|||
Loading…
Reference in New Issue