Fix setMediaPlaybackDisabled when reduxActions not ready

This commit is contained in:
ayumi-signal 2024-02-21 10:54:33 -08:00 committed by GitHub
parent fbefbcea73
commit c5b8f49f25
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -694,9 +694,9 @@ export function createIPCEvents(
getMediaCameraPermissions: window.IPC.getMediaCameraPermissions,
setMediaPlaybackDisabled: (playbackDisabled: boolean) => {
window.reduxActions.lightbox.setPlaybackDisabled(playbackDisabled);
window.reduxActions?.lightbox.setPlaybackDisabled(playbackDisabled);
if (playbackDisabled) {
window.reduxActions.audioPlayer.pauseVoiceNotePlayer();
window.reduxActions?.audioPlayer.pauseVoiceNotePlayer();
}
},