Fixes to voice notes playback

This commit is contained in:
Alvaro 2023-02-28 06:07:40 -07:00 committed by GitHub
parent fad0529080
commit 3d4248e070
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 285 additions and 274 deletions

View file

@ -155,11 +155,14 @@ export async function computePeaks(
const pending = inProgressMap.get(computeKey);
if (pending) {
log.info('GlobalAudioContext: already computing peaks for', computeKey);
log.info(
'VoiceNotesPlaybackContext: already computing peaks for',
computeKey
);
return pending;
}
log.info('GlobalAudioContext: queue computing peaks for', computeKey);
log.info('VoiceNotesPlaybackContext: queue computing peaks for', computeKey);
const promise = computeQueue.add(() => doComputePeaks(url, barCount));
inProgressMap.set(computeKey, promise);
@ -178,10 +181,7 @@ export const VoiceNotesPlaybackContext =
React.createContext<Contents>(globalContents);
export type VoiceNotesPlaybackProps = {
conversationId: string | undefined;
isPaused: boolean;
children?: React.ReactNode | React.ReactChildren;
unloadMessageAudio: () => void;
};
/**