fix: resolve issue with blocking audio and video without the option being active

Details:
- Fixed the problem where audio and video were being blocked even when the option was not active.
master
gustavo-gsp 2024-06-27 14:10:26 -03:00
parent e30573519d
commit 2bb5db92d7
1 changed files with 4 additions and 6 deletions

View File

@ -184,12 +184,10 @@ const verifyMediaMessage = async (
phoneNumberId: msg?.phoneNumberId,
fromAgent: false
};
if (
messageData.mediaType === "video" ||
(messageData.mediaType === "audio" &&
getSettingValue("blockAudioVideoMedia")?.value === "enabled")
) {
mediaAuthorized = false;
if(getSettingValue('blockAudioVideoMedia')?.value === 'enabled'){
if( messageData.mediaType === 'video' || messageData.mediaType === 'audio' ){
mediaAuthorized = false;
}
}
if (msg?.fromMe) {
messageData = { ...messageData, fromAgent: true };