refactor(03-03): remove diagnostic logging after fix verified
- Remove all [RENDER], [EFFECT], and [DEBUG] console logs - Keep only error logging for production - Player now loads successfully in popup mode Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
496e76f9af
commit
c5a0f8cf94
|
|
@ -92,24 +92,11 @@ const JKSessionBackingTrackPlayer = ({
|
|||
// Specific retry logic handled by individual operations
|
||||
}, [clearError]);
|
||||
|
||||
// Debug: Log component state
|
||||
console.log('[RENDER] Component rendered with:', {
|
||||
isOpen,
|
||||
hasBackingTrack: !!backingTrack,
|
||||
hasJamClient: !!jamClient,
|
||||
backingTrack,
|
||||
isLoadingDuration
|
||||
});
|
||||
|
||||
useEffect(() => {
|
||||
console.log('[EFFECT] Duration useEffect triggered', { isOpen, isPopup, hasBackingTrack: !!backingTrack, hasJamClient: !!jamClient });
|
||||
|
||||
// For popup mode, treat as always "open" since the popup window itself indicates open state
|
||||
const shouldInitialize = (isOpen || isPopup) && backingTrack && jamClient;
|
||||
console.log('[EFFECT] Should initialize?', shouldInitialize);
|
||||
|
||||
if (shouldInitialize) {
|
||||
console.log('[EFFECT] Condition passed, initializing...');
|
||||
// Initialize player state when opened
|
||||
setIsPlaying(false);
|
||||
setCurrentTime('0:00');
|
||||
|
|
@ -118,22 +105,17 @@ const JKSessionBackingTrackPlayer = ({
|
|||
// Fetch and set duration immediately when track loads (async)
|
||||
const fetchDuration = async () => {
|
||||
setIsLoadingDuration(true);
|
||||
console.log('[DEBUG] Fetching duration...');
|
||||
try {
|
||||
if (!jamClient) {
|
||||
console.log('[DEBUG] No jamClient available');
|
||||
handleError('general', 'Audio engine not available', null);
|
||||
setIsLoadingDuration(false);
|
||||
return;
|
||||
}
|
||||
|
||||
console.log('[DEBUG] Calling SessionGetTracksPlayDurationMs...');
|
||||
const durationInMs = await jamClient.SessionGetTracksPlayDurationMs();
|
||||
console.log('[DEBUG] Duration received:', durationInMs, 'Type:', typeof durationInMs);
|
||||
|
||||
// Convert string to number (jamClient returns string values)
|
||||
const validDuration = parseInt(durationInMs, 10) || 0;
|
||||
console.log('[DEBUG] Parsed duration:', validDuration);
|
||||
|
||||
// Check for invalid duration (file error)
|
||||
if (validDuration === 0 || isNaN(validDuration)) {
|
||||
|
|
@ -149,14 +131,11 @@ const JKSessionBackingTrackPlayer = ({
|
|||
const oneSecondMs = 1000;
|
||||
// Validation logic exists but logs removed for production
|
||||
|
||||
console.log('[DEBUG] Setting duration to:', validDuration, 'formatted:', formatTime(validDuration));
|
||||
setDurationMs(validDuration);
|
||||
setDuration(formatTime(validDuration));
|
||||
clearError(); // Clear any previous errors
|
||||
setIsLoadingDuration(false);
|
||||
console.log('[DEBUG] Duration fetch complete, loading set to false');
|
||||
} catch (error) {
|
||||
console.log('[DEBUG] Error fetching duration:', error);
|
||||
handleError('file', 'Failed to load track duration', error);
|
||||
setDuration('0:00');
|
||||
setDurationMs(0);
|
||||
|
|
|
|||
Loading…
Reference in New Issue