Merge remote-tracking branch 'mkljczk/mastodon-redraft' into pleroma-redraft-quirk

This commit is contained in:
Alex Gleason
2022-03-16 19:50:41 -05:00
3 changed files with 4 additions and 2 deletions

View File

@ -101,13 +101,14 @@ export function redraft(status, raw_text, content_type) {
return (dispatch, getState) => {
const state = getState();
const instance = state.get('instance');
const { explicitAddressing } = getFeatures(instance);
const { explicitAddressing, redraftMedia } = getFeatures(instance);
dispatch({
type: REDRAFT,
status,
raw_text,
explicitAddressing,
redraftMedia,
content_type,
});
};

View File

@ -432,7 +432,7 @@ export default function compose(state = initialState, action) {
map.set('in_reply_to', action.status.get('in_reply_to_id'));
map.set('privacy', action.status.get('visibility'));
// TODO: Actually fix this rather than just removing it
// map.set('media_attachments', action.status.get('media_attachments'));
if (action.redraftMedia) map.set('media_attachments', action.status.get('media_attachments'));
map.set('focusDate', new Date());
map.set('caretPosition', null);
map.set('idempotencyKey', uuid());

View File

@ -110,6 +110,7 @@ export const getFeatures = createSelector([instance => instance], instance => {
v.software === MASTODON && gte(v.compatVersion, '3.2.0'),
v.software === PLEROMA && gte(v.version, '2.4.50'),
]),
redraftMedia: v.software === MASTODON,
}, overrides);
});