mirror of
https://github.com/cheeaun/phanpy.git
synced 2025-01-23 00:56:23 +01:00
Fix snakecase not working in Compose pop-out
This commit is contained in:
parent
b25b54b79e
commit
e96cc9cc16
1 changed files with 10 additions and 3 deletions
|
@ -658,16 +658,23 @@ function Compose({
|
|||
console.log({ results, mediaAttachments });
|
||||
}
|
||||
|
||||
/* NOTE:
|
||||
Using snakecase here because masto.js's `isObject` returns false for `params`, ONLY happens when opening in pop-out window. This is maybe due to `window.masto` variable being passed from the parent window. The check that failed is `x.constructor === Object`, so maybe the `Object` in new window is different than parent window's?
|
||||
Code: https://github.com/neet/masto.js/blob/dd0d649067b6a2b6e60fbb0a96597c373a255b00/src/serializers/is-object.ts#L2
|
||||
*/
|
||||
let params = {
|
||||
status,
|
||||
spoilerText,
|
||||
// spoilerText,
|
||||
spoiler_text: spoilerText,
|
||||
sensitive,
|
||||
poll,
|
||||
mediaIds: mediaAttachments.map((attachment) => attachment.id),
|
||||
// mediaIds: mediaAttachments.map((attachment) => attachment.id),
|
||||
media_ids: mediaAttachments.map((attachment) => attachment.id),
|
||||
};
|
||||
if (!editStatus) {
|
||||
params.visibility = visibility;
|
||||
params.inReplyToId = replyToStatus?.id || undefined;
|
||||
// params.inReplyToId = replyToStatus?.id || undefined;
|
||||
params.in_reply_to_id = replyToStatus?.id || undefined;
|
||||
}
|
||||
params = removeNullUndefined(params);
|
||||
console.log('POST', params);
|
||||
|
|
Loading…
Reference in a new issue