Browse Source

[Glitch] Fix focus point of already-attached media not saving after edit

Port b2283b6838 to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
closed-social-glitch-2
Claire 1 year ago
parent
commit
8c8358b3cf
1 changed files with 13 additions and 5 deletions
  1. +13
    -5
      app/javascript/flavours/glitch/actions/compose.js

+ 13
- 5
app/javascript/flavours/glitch/actions/compose.js View File

@ -186,11 +186,19 @@ export function submitCompose(routerHistory) {
// API call.
let media_attributes;
if (statusId !== null) {
media_attributes = media.map(item => ({
id: item.get('id'),
description: item.get('description'),
focus: item.get('focus'),
}));
media_attributes = media.map(item => {
let focus;
if (item.getIn(['meta', 'focus'])) {
focus = `${item.getIn(['meta', 'focus', 'x']).toFixed(2)},${item.getIn(['meta', 'focus', 'y']).toFixed(2)}`;
}
return {
id: item.get('id'),
description: item.get('description'),
focus,
};
});
}
api(getState).request({

Loading…
Cancel
Save