Remove text requirement when media attached from statuses (#6672)
This commit is contained in:
@ -90,7 +90,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());
|
||||
|
||||
@ -101,12 +100,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) {
|
||||
|
Reference in New Issue
Block a user