From c95d143065fa9e655e3b76ff5fe03129dc91152d Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Mon, 2 Oct 2023 23:37:43 -0700 Subject: [PATCH] check file type properly --- packages/client/src/components/MkPostFormAttaches.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/client/src/components/MkPostFormAttaches.vue b/packages/client/src/components/MkPostFormAttaches.vue index 8d7ffb656a..1b7df14c02 100644 --- a/packages/client/src/components/MkPostFormAttaches.vue +++ b/packages/client/src/components/MkPostFormAttaches.vue @@ -78,7 +78,7 @@ function toggleSensitive(file) { } function cropImage(file) { - if (file.type !== "image") return; + if (!["png", "webp", "jpg", "jpeg"].includes(file.type)) return; os.cropImage(file).then((newFile) => { emits("cropImage", newFile); }); @@ -155,7 +155,7 @@ function showFileMenu(file, ev: MouseEvent) { describe(file); }, }, - file.type === "image" ? { + ["png", "webp", "jpg", "jpeg"].includes(file.type) ? { text: i18n.ts.cropImage, icon: "ph-crop ph-bold ph-lg", action: () => {