Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

attach file if result is true

ammarahm-ed84fb900e2e2f
diff --git a/apps/mobile/src/views/Editor/tiny/toolbar/picker.js b/apps/mobile/src/views/Editor/tiny/toolbar/picker.js
index e597ff33d..bdfdc0c75 100644
--- a/apps/mobile/src/views/Editor/tiny/toolbar/picker.js
+++ b/apps/mobile/src/views/Editor/tiny/toolbar/picker.js
@@ -281,7 +281,8 @@ const handleImageResponse = async response => {
type: 'url'
});
let fileName = image.originalFileName || image.fileName;
- await attachFile(uri, hash, image.type, fileName, 'image');
+ let result = await attachFile(uri, hash, image.type, fileName, 'image');
+ if (!result) return;
tiny.call(
EditorWebView,
`
@@ -303,7 +304,6 @@ const handleImageResponse = async response => {
})();
`
);
-
};
async function attachFile(uri, hash, type, filename) {