From ec84cb695db9574287c0b9375e076beeab894fb5 Mon Sep 17 00:00:00 2001 From: Douglas Fabris Date: Thu, 3 Nov 2022 16:08:28 -0300 Subject: [PATCH] [FIX] Uploading Custom Sound files not working, but showing success (#27177) --- .../app/custom-sounds/server/methods/uploadCustomSound.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/apps/meteor/app/custom-sounds/server/methods/uploadCustomSound.js b/apps/meteor/app/custom-sounds/server/methods/uploadCustomSound.js index 633903348702..e87449c79c16 100644 --- a/apps/meteor/app/custom-sounds/server/methods/uploadCustomSound.js +++ b/apps/meteor/app/custom-sounds/server/methods/uploadCustomSound.js @@ -16,10 +16,7 @@ Meteor.methods({ const rs = RocketChatFile.bufferToStream(file); RocketChatFileCustomSoundsInstance.deleteFile(`${soundData._id}.${soundData.extension}`); const ws = RocketChatFileCustomSoundsInstance.createWriteStream(`${soundData._id}.${soundData.extension}`, contentType); - ws.on( - 'end', - setTimeout(() => api.broadcast('notify.updateCustomSound', { soundData }), 500), - ); + ws.on('end', () => setTimeout(() => api.broadcast('notify.updateCustomSound', { soundData }), 500)); rs.pipe(ws); },