Browse Source

Fix attached media uploads not being cleared when replying to a post (#23504)

closed-social-glitch-2
Claire 1 year ago
committed by GitHub
parent
commit
bae17ebe5e
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 0 deletions
  1. +5
    -0
      app/javascript/mastodon/features/compose/components/upload.js
  2. +2
    -0
      app/javascript/mastodon/reducers/compose.js

+ 5
- 0
app/javascript/mastodon/features/compose/components/upload.js View File

@ -31,6 +31,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;

+ 2
- 0
app/javascript/mastodon/reducers/compose.js View File

@ -330,6 +330,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 {

Loading…
Cancel
Save