diff options
author | Claire <claire.github-309c@sitedethib.com> | 2023-02-20 22:41:20 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-20 22:41:20 +0100 |
commit | 45087c1092143e95dfcc85b6c9abc5c6c0a0a5c2 (patch) | |
tree | e4be53cb0b2e7f876bea6c61d4fe64d7586ae63d /app/javascript/flavours/glitch/actions | |
parent | 4c68189d2b8b6a9a74fc13862b11bf6c6d523409 (diff) | |
parent | dc0cc5a57d224b4c53bc58dad919b727055bd9a3 (diff) |
Merge pull request #2117 from ClearlyClaire/glitch-soc/merge-upstream
Merge upstream changes
Diffstat (limited to 'app/javascript/flavours/glitch/actions')
-rw-r--r-- | app/javascript/flavours/glitch/actions/compose.js | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/app/javascript/flavours/glitch/actions/compose.js b/app/javascript/flavours/glitch/actions/compose.js index 01f0f3666..9c0ef83df 100644 --- a/app/javascript/flavours/glitch/actions/compose.js +++ b/app/javascript/flavours/glitch/actions/compose.js @@ -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({ |