about summary refs log tree commit diff
path: root/app/javascript/flavours/glitch/reducers
diff options
context:
space:
mode:
authorClaire <claire.github-309c@sitedethib.com>2023-02-10 22:03:35 +0100
committerClaire <claire.github-309c@sitedethib.com>2023-02-13 20:04:45 +0100
commit58291b31fa8eff7bb5dd76b605377a33a977fa5a (patch)
tree38218e55404a1bb8e3f0eb65f1772cf90f87d434 /app/javascript/flavours/glitch/reducers
parentce84d163ccaa1f38f9fe5dc829a5da80495632c2 (diff)
[Glitch] Fix attached media uploads not being cleared when replying to a post
Port bae17ebe5eab02879599ae8516cf6b3f6736b450 to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
Diffstat (limited to 'app/javascript/flavours/glitch/reducers')
-rw-r--r--app/javascript/flavours/glitch/reducers/compose.js2
1 files changed, 2 insertions, 0 deletions
diff --git a/app/javascript/flavours/glitch/reducers/compose.js b/app/javascript/flavours/glitch/reducers/compose.js
index 57ab36b3d..c31cc5694 100644
--- a/app/javascript/flavours/glitch/reducers/compose.js
+++ b/app/javascript/flavours/glitch/reducers/compose.js
@@ -421,6 +421,8 @@ export default function compose(state = initialState, action) {
       map.set('preselectDate', new Date());
       map.set('idempotencyKey', uuid());
 
+      map.update('media_attachments', list => list.filter(media => media.get('unattached')));
+
       if (action.status.get('language') && !action.status.has('translation')) {
         map.set('language', action.status.get('language'));
       } else {