From 6582b36ad95ddb44fa89428f69d482160be2f832 Mon Sep 17 00:00:00 2001 From: Jordan Handy <6423379+jordanhandy@users.noreply.github.com> Date: Sun, 21 Nov 2021 10:33:21 -0500 Subject: [PATCH] error messages --- main.js | 4 ++-- src/main.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/main.js b/main.js index dee88e3..d077306 100755 --- a/main.js +++ b/main.js @@ -2655,7 +2655,7 @@ var CloudinaryUploader = class extends import_obsidian2.Plugin { const {files} = evt.clipboardData; if (files.length == 0 && !files[0].type.startsWith("text")) { editor.replaceSelection("Clipboard data is not an image\n"); - } else if (this.settings.cloudName && this.settings.uploadPreset) { + } else if (this.settings.cloudName && this.settings.uploadPreset && files[0].type.startsWith("image")) { for (let file of files) { evt.preventDefault(); const randomString = (Math.random() * 10086).toString(36).substr(0, 8); @@ -2681,7 +2681,7 @@ var CloudinaryUploader = class extends import_obsidian2.Plugin { } } else { new import_obsidian2.Notice("Cloudinary Image Uploader: Please check the image hosting settings."); - editor.replaceSelection("Please check settings for upload"); + editor.replaceSelection("Please check settings for upload\n This will also appear if file is not of image type"); } })); } diff --git a/src/main.ts b/src/main.ts index cb23830..c25e0c4 100755 --- a/src/main.ts +++ b/src/main.ts @@ -33,7 +33,7 @@ export default class CloudinaryUploader extends Plugin { if (files.length == 0 && !files[0].type.startsWith("text")) { editor.replaceSelection("Clipboard data is not an image\n"); } - else if (this.settings.cloudName && this.settings.uploadPreset) { + else if (this.settings.cloudName && this.settings.uploadPreset && files[0].type.startsWith("image")) { for (let file of files) { evt.preventDefault(); @@ -62,7 +62,7 @@ export default class CloudinaryUploader extends Plugin { } else { new Notice("Cloudinary Image Uploader: Please check the image hosting settings."); - editor.replaceSelection("Please check settings for upload"); + editor.replaceSelection("Please check settings for upload\n This will also appear if file is not of image type"); } }))