Allow pasting attachments on Akkoma / Pleroma instances
Fixes #656.
See commit titles for info on how the bug was fixed!
@Steffo99 I saw the code formatting is a little off. Your code editor might need some prettier plugin to follow the project's prettier settings 🙇
I saw the code formatting is a little off. Your code editor might need some prettier plugin to follow the project's prettier settings 🙇
Oh, I didn't notice the .prettierrc file, and I had my editor configured to use .editorconfig instead; thanks for letting me know!
What, shouldn't this:
https://github.com/cheeaun/phanpy/blob/0f6f20629ef4104bfdac10951b14dc0ed42e708f/src/components/compose.jsx#L1308-L1340
Share behaviour with this function?:
https://github.com/cheeaun/phanpy/blob/0f6f20629ef4104bfdac10951b14dc0ed42e708f/src/components/compose.jsx#L600-L647
I think that's the reason why the attach button worked but copy-and-pasting not in #656: onChange does not check mime types!
@cheeaun How would you want me to handle this? Should I just leave it alone? In that case, the PR is ready...
Whoops. Committed via web and forgot to enter commit text. A sec!
What, shouldn't this:
https://github.com/cheeaun/phanpy/blob/0f6f20629ef4104bfdac10951b14dc0ed42e708f/src/components/compose.jsx#L1308-L1340
Share behaviour with this function?:
https://github.com/cheeaun/phanpy/blob/0f6f20629ef4104bfdac10951b14dc0ed42e708f/src/components/compose.jsx#L600-L647
I think that's the reason why the attach button worked but copy-and-pasting not in #656:
onChangedoes not check mime types!
You mean the filtering logic with supportedMimeTypes? The other one has accept attribute which should already filter the files (I hope).
The other one has accept attribute which should already filter the files (I hope).
Alas, it doesn't prevent the user from adding files not matching the MIME types listed there, it just filters them by default in the file picker:
I guess that's a https://github.com/cheeaun/phanpy/labels/bug for a different pull request, though.
Possible to resolve the conflicts here? Thanks
@cheeaun Done!
There seem to be non-prettified files in the main branch; not modifying those to prevent more conflicts.