From 909c315a44a5c6272f000325e5e9c8b33e75f873 Mon Sep 17 00:00:00 2001
From: taehoon
Date: Sun, 17 Mar 2019 23:23:59 -0400
Subject: [PATCH] Get correct mimetype through entity_normalizer
---
src/components/post_status_form/post_status_form.js | 2 +-
src/services/entity_normalizer/entity_normalizer.service.js | 5 ++---
2 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/src/components/post_status_form/post_status_form.js b/src/components/post_status_form/post_status_form.js
index 142d9d90..1f0df35a 100644
--- a/src/components/post_status_form/post_status_form.js
+++ b/src/components/post_status_form/post_status_form.js
@@ -292,7 +292,7 @@ const PostStatusForm = {
this.submitDisabled = false
},
type (fileInfo) {
- return fileTypeService.fileType(fileInfo.pleroma.mime_type)
+ return fileTypeService.fileType(fileInfo.mimetype)
},
paste (e) {
if (e.clipboardData.files.length > 0) {
diff --git a/src/services/entity_normalizer/entity_normalizer.service.js b/src/services/entity_normalizer/entity_normalizer.service.js
index 57a6adf9..0d653207 100644
--- a/src/services/entity_normalizer/entity_normalizer.service.js
+++ b/src/services/entity_normalizer/entity_normalizer.service.js
@@ -128,13 +128,12 @@ export const parseUser = (data) => {
return output
}
-const parseAttachment = (data) => {
+export const parseAttachment = (data) => {
const output = {}
const masto = !data.hasOwnProperty('oembed')
if (masto) {
- // Not exactly same...
- output.mimetype = data.type
+ output.mimetype = data.pleroma.mime_type
output.meta = data.meta // not present in BE yet
} else {
output.mimetype = data.mimetype