Thank you for using JamKazam! Your feedback helps us improve the experience for everyone.
+ +Set the input level of your Audio Inputs for each of your tracks to a healthy level. It's important to set your input level correctly. If your level is set too high, you'll get distortion or clipping of your audio. If set too low, your audio signal will be too weak, which can cause noise and degrade your audio quality when you and others use the session mix to increase your volume in the mix.
diff --git a/jam-ui/src/helpers/rest.js b/jam-ui/src/helpers/rest.js index 256145263..21c0fc705 100644 --- a/jam-ui/src/helpers/rest.js +++ b/jam-ui/src/helpers/rest.js @@ -896,4 +896,15 @@ export const updateSessionSettings = (options = {}) => { .then(response => resolve(response)) .catch(error => reject(error)); }); -} \ No newline at end of file +} + +export const submitSessionFeedback = (clientId, options = {}) => { + return new Promise((resolve, reject) => { + apiFetch(`/participant_histories/${clientId}/rating`, { + method: 'POST', + body: JSON.stringify(options) + }) + .then(response => resolve(response)) + .catch(error => reject(error)); + }); +} diff --git a/jam-ui/src/hooks/useSessionModel.js b/jam-ui/src/hooks/useSessionModel.js index 1dc859c44..ee50f9bbd 100644 --- a/jam-ui/src/hooks/useSessionModel.js +++ b/jam-ui/src/hooks/useSessionModel.js @@ -1,4 +1,5 @@ import { useState, useCallback, useRef, useEffect } from 'react'; +import { useHistory } from 'react-router-dom'; import { debounce } from 'lodash'; // Add lodash for debouncing import { useJamClient } from '../context/JamClientContext'; import { useCurrentSessionContext } from '../context/CurrentSessionContext'; @@ -34,6 +35,7 @@ export default function useSessionModel(app, server, sessionScreen) { const { getTrackInfo, getUserTracks } = useTrackHelpers(); const { getCurrentRecordingState, reset: resetRecordingState } = useRecordingHelpers(); const { currentSession, setCurrentSession, currentSessionIdRef, setCurrentSessionId, inSession } = useCurrentSessionContext(); + const history = useHistory(); // State variables from original SessionModel const [userTracks, setUserTracks] = useState(null); @@ -395,6 +397,7 @@ export default function useSessionModel(app, server, sessionScreen) { // Perform the actual leave session (from useSessionLeave) const performLeaveSession = useCallback(async () => { + if (isLeavingRef.current) { logger.debug("Leave session already in progress"); return; @@ -416,6 +419,8 @@ export default function useSessionModel(app, server, sessionScreen) { } } + + // Leave the session via jamClient (don't wait for REST) logger.debug("Leaving session via jamClient for sessionId:", sessionId); try { @@ -426,7 +431,7 @@ export default function useSessionModel(app, server, sessionScreen) { } // Make REST call to server (fire and forget for faster UX) - leaveSessionRest(sessionId); + await leaveSessionRest(sessionId); // Unregister callbacks try { @@ -437,6 +442,8 @@ export default function useSessionModel(app, server, sessionScreen) { logger.error("Error unregistering callbacks:", error); } + + // Call session page leave try { // Note: SessionPageLeave would need to be imported from useSessionUtils @@ -448,12 +455,13 @@ export default function useSessionModel(app, server, sessionScreen) { // Trigger session ended event // TODO: Re-implement this with React context or state management - if (document && window.$) { - // $(document).trigger('SESSION_ENDED', { session: { id: sessionId } }); - logger.debug("Session ended event triggered"); - } + // if (document && window.$) { + // // $(document).trigger('SESSION_ENDED', { session: { id: sessionId } }); + // logger.debug("Session ended event triggered"); + // } logger.debug("Session leave completed successfully"); + } catch (error) { logger.error("Unexpected error during session leave:", error); @@ -468,7 +476,7 @@ export default function useSessionModel(app, server, sessionScreen) { // Main leave session function (from useSessionLeave) const leaveSession = useCallback(async () => { - return performLeaveSession(); + await performLeaveSession(); }, [performLeaveSession]); // Handle leave session with behavior (navigation, notifications, etc.) (from useSessionLeave) @@ -477,36 +485,38 @@ export default function useSessionModel(app, server, sessionScreen) { try { // Handle notifications - if (behavior.notify && window.JK?.app?.layout) { - window.JK.app.layout.notify(behavior.notify); - } + // if (behavior.notify && window.JK?.app?.layout) { + // window.JK.app.layout.notify(behavior.notify); + // } - // Allow leave session (trigger any leave confirmation logic) - if (window.SessionActions?.allowLeaveSession) { - window.SessionActions.allowLeaveSession.trigger(); - } + // // Allow leave session (trigger any leave confirmation logic) + // if (window.SessionActions?.allowLeaveSession) { + // window.SessionActions.allowLeaveSession.trigger(); + // } // Perform the leave operation await leaveSession(); // Handle navigation after successful leave - if (behavior.location) { - if (typeof behavior.location === 'number') { - window.history.go(behavior.location); - } else { - window.location = behavior.location; - } - } else if (behavior.hash) { - window.location.hash = behavior.hash; - } else { - logger.warn("No location specified in leaveSession action, defaulting to home", behavior); - window.location = '/client#/home'; - } + // if (behavior.location) { + // if (typeof behavior.location === 'number') { + // window.history.go(behavior.location); + // } else { + // window.location = behavior.location; + // } + // } else if (behavior.hash) { + // window.location.hash = behavior.hash; + // } else { + // logger.warn("No location specified in leaveSession action, defaulting to home", behavior); + // window.location = '/client#/home'; + // } // Handle lesson session rating if applicable // Note: This would need additional context/state to implement fully // For now, just log that rating logic would go here - logger.debug("Lesson session rating logic would be handled here"); + //logger.debug("Lesson session rating logic would be handled here"); + + } catch (error) { logger.error("Error handling leave session:", error);