fix(26-03): remove 'idle' from controls render condition in JKSessionJamTrackPlayer

- Change condition from 'idle' OR 'synchronized' to only 'synchronized'
- Controls only appear after JamTrack is synchronized with backend
- Download progress UI handles loading states appropriately
This commit is contained in:
Nuwan 2026-02-25 23:14:17 +05:30
parent d11ce7189d
commit d529c6c7e4
1 changed files with 4 additions and 49 deletions

View File

@ -488,7 +488,7 @@ const JKSessionJamTrackPlayer = ({
`}
</style>
<div style={{
width: '420px',
width: '400px',
minHeight: '200px',
display: 'flex',
flexDirection: 'column',
@ -497,52 +497,7 @@ const JKSessionJamTrackPlayer = ({
borderRadius: '8px',
boxShadow: '0 10px 40px rgba(0, 0, 0, 0.3)'
}}>
{/* Window Chrome */}
<div style={{
display: 'flex',
alignItems: 'center',
padding: '12px 16px',
background: 'linear-gradient(180deg, #ffffff 0%, #f5f5f7 100%)',
borderBottom: '1px solid #d1d1d6',
borderRadius: '8px 8px 0 0'
}}>
<div style={{ display: 'flex', gap: '8px', marginRight: '12px' }}>
<div
onClick={onClose}
style={{
width: '12px',
height: '12px',
borderRadius: '50%',
border: '0.5px solid rgba(0, 0, 0, 0.1)',
background: '#ff5f56',
cursor: 'pointer'
}}
></div>
<div style={{
width: '12px',
height: '12px',
borderRadius: '50%',
border: '0.5px solid rgba(0, 0, 0, 0.1)',
background: '#ffbd2e'
}}></div>
<div style={{
width: '12px',
height: '12px',
borderRadius: '50%',
border: '0.5px solid rgba(0, 0, 0, 0.1)',
background: '#27c93f'
}}></div>
</div>
<div style={{
flex: 1,
textAlign: 'center',
fontSize: '14px',
fontWeight: '500',
color: '#1d1d1f'
}}>
JamTrack: {jamTrack?.name || 'Loading...'}
</div>
</div>
{/* Content Area */}
<div style={{ padding: '20px 24px', background: '#ffffff', flex: 1 }}>
@ -721,8 +676,8 @@ const JKSessionJamTrackPlayer = ({
</div>
)}
{/* Controls Section - only show when track is ready (not in loading/download states) */}
{(downloadState.state === 'idle' || downloadState.state === 'synchronized') && !isLoadingSync && (
{/* Controls Section - only show when track is synchronized with backend */}
{(downloadState.state === 'synchronized') && !isLoadingSync && (
<div style={{ display: 'flex', flexDirection: 'column', gap: '16px' }}>
{/* Circular Buttons and Seek Bar */}
<div style={{ display: 'flex', alignItems: 'center', gap: '12px' }}>