From 09054f54854688a27c347a6618a3209ccdfc840a Mon Sep 17 00:00:00 2001 From: Christian Schmidt Date: Sun, 30 Apr 2023 02:29:24 +0200 Subject: [PATCH] [Glitch] Fix media description not being cleared Port bfeccf67486d105d4c2a07719fdf4772652bad74 to glitch-soc Signed-off-by: Claire --- app/javascript/flavours/glitch/actions/compose.js | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/app/javascript/flavours/glitch/actions/compose.js b/app/javascript/flavours/glitch/actions/compose.js index 9c0ef83df5..f0d50ccf13 100644 --- a/app/javascript/flavours/glitch/actions/compose.js +++ b/app/javascript/flavours/glitch/actions/compose.js @@ -441,16 +441,12 @@ export function changeUploadCompose(id, params) { // Editing already-attached media is deferred to editing the post itself. // For simplicity's sake, fake an API reply. if (media && !media.get('unattached')) { - let { description, focus } = params; - const data = media.toJS(); - - if (description) { - data.description = description; - } + const { focus, ...other } = params; + const data = { ...media.toJS(), ...other }; if (focus) { - focus = focus.split(','); - data.meta = { focus: { x: parseFloat(focus[0]), y: parseFloat(focus[1]) } }; + const [x, y] = focus.split(','); + data.meta = { focus: { x: parseFloat(x), y: parseFloat(y) } }; } dispatch(changeUploadComposeSuccess(data, true));