check file type properly
This commit is contained in:
parent
303ae1c844
commit
c95d143065
1 changed files with 2 additions and 2 deletions
|
@ -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: () => {
|
||||
|
|
Loading…
Reference in a new issue