about summary refs log tree commit diff
path: root/app/javascript/flavours/glitch/reducers
diff options
context:
space:
mode:
authorThibaut Girka <thib@sitedethib.com>2018-03-12 18:39:07 +0100
committerThibaut Girka <thib@sitedethib.com>2018-03-12 18:39:07 +0100
commit841ef606a9b1bc3390830643606b3ec9d65d5120 (patch)
tree74ba0f1cb8611a6e8e52b778ade872f028fb075f /app/javascript/flavours/glitch/reducers
parenta0724cd7426dec36b7966c86a1708f62e6e5fd4c (diff)
Remove text requirement when media attached from statuses (fixes #381)
Ports cfa9b6e13ab3c434f3901df6f614d0aa94a3d1ed to glitchsoc
Diffstat (limited to 'app/javascript/flavours/glitch/reducers')
-rw-r--r--app/javascript/flavours/glitch/reducers/compose.js3
1 files changed, 0 insertions, 3 deletions
diff --git a/app/javascript/flavours/glitch/reducers/compose.js b/app/javascript/flavours/glitch/reducers/compose.js
index 722670cf1..8973c7713 100644
--- a/app/javascript/flavours/glitch/reducers/compose.js
+++ b/app/javascript/flavours/glitch/reducers/compose.js
@@ -158,7 +158,6 @@ function appendMedia(state, media) {
     map.update('media_attachments', list => list.push(media));
     map.set('is_uploading', false);
     map.set('resetFileKey', Math.floor((Math.random() * 0x10000)));
-    map.update('text', oldText => `${oldText.trim()} ${media.get('text_url')}`);
     map.set('focusDate', new Date());
     map.set('idempotencyKey', uuid());
 
@@ -169,12 +168,10 @@ function appendMedia(state, media) {
 };
 
 function removeMedia(state, mediaId) {
-  const media    = state.get('media_attachments').find(item => item.get('id') === mediaId);
   const prevSize = state.get('media_attachments').size;
 
   return state.withMutations(map => {
     map.update('media_attachments', list => list.filterNot(item => item.get('id') === mediaId));
-    map.update('text', text => text.replace(media.get('text_url'), '').trim());
     map.set('idempotencyKey', uuid());
 
     if (prevSize === 1) {