Composer: Fix pasting image from clipboard on Linux (#1451)

This commit is contained in:
Alexander Zinchuk 2021-09-17 17:17:19 +03:00
parent b95e804a9f
commit ae3f2f9c21

View File

@ -24,7 +24,8 @@ export default (
}
const { items } = e.clipboardData;
const media = Array.from(items).find((item) => CLIPBOARD_ACCEPTED_TYPES.includes(item.type));
const media = Array.from(items)
.find((item) => CLIPBOARD_ACCEPTED_TYPES.includes(item.type) && item.kind === 'file');
const file = media && media.getAsFile();
const pastedText = e.clipboardData.getData('text').substring(0, MAX_MESSAGE_LENGTH);