about summary refs log tree commit diff
path: root/app/javascript/flavours/glitch/features/compose
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/features/compose
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/features/compose')
-rw-r--r--app/javascript/flavours/glitch/features/compose/components/upload.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/app/javascript/flavours/glitch/features/compose/components/upload.js b/app/javascript/flavours/glitch/features/compose/components/upload.js
index c82b8d55a..63582c636 100644
--- a/app/javascript/flavours/glitch/features/compose/components/upload.js
+++ b/app/javascript/flavours/glitch/features/compose/components/upload.js
@@ -32,6 +32,11 @@ export default class Upload extends ImmutablePureComponent {
 
   render () {
     const { media } = this.props;
+
+    if (!media) {
+      return null;
+    }
+
     const focusX = media.getIn(['meta', 'focus', 'x']);
     const focusY = media.getIn(['meta', 'focus', 'y']);
     const x = ((focusX /  2) + .5) * 100;