Include media attachments when redrafting on Mastodon

Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
remove-makegetotheraccounts
marcin mikołajczak 2022-03-10 18:47:20 +01:00
rodzic a63aa16472
commit 71ea3ed425
3 zmienionych plików z 4 dodań i 2 usunięć

Wyświetl plik

@ -101,13 +101,14 @@ export function redraft(status, raw_text) {
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,
});
};
}

Wyświetl plik

@ -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());

Wyświetl plik

@ -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);
});