fix(28-02): check pendingUpdates in getLevelSnapshot

The vuStore RAF loop only runs with subscribers, but SessionTrackVU
uses direct polling without subscribing. Changed getLevelSnapshot to
check pendingUpdates first for immediate access to latest VU data.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Nuwan 2026-03-05 15:03:28 +05:30
parent a020e27260
commit a1d24fe385
1 changed files with 3 additions and 1 deletions

View File

@ -97,12 +97,14 @@ export const vuStore = {
/**
* Get snapshot of single mixer's VU level
* More efficient for components that only need one mixer's data
* Checks both pending updates and flushed levels for immediate access
*
* @param {string} mixerId - Qualified mixer ID
* @returns {Object|null} - { level, clipping, timestamp } or null
*/
getLevelSnapshot(mixerId) {
return vuLevels[mixerId] || null;
// Check pending updates first (most recent), then flushed levels
return pendingUpdates[mixerId] || vuLevels[mixerId] || null;
},
/**