1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-13 17:56:25 +00:00

removed uneeded line of code

This commit is contained in:
milotodt
2019-04-02 16:04:35 -07:00
committed by Junyoung Choi
parent eeec1b12b5
commit 9b03a32eec

View File

@@ -274,13 +274,12 @@ function generateAttachmentMarkdown (fileName, path, showPreview) {
* @param {String} noteKey Key of the current note * @param {String} noteKey Key of the current note
* @param {Event} dropEvent DropEvent * @param {Event} dropEvent DropEvent
*/ */
function handleAttachmentDrop(codeEditor, storageKey, noteKey, dropEvent) { function handleAttachmentDrop (codeEditor, storageKey, noteKey, dropEvent) {
let promise let promise
if (dropEvent.dataTransfer.files.length > 0) { if (dropEvent.dataTransfer.files.length > 0) {
promise = Promise.all(Array.from(dropEvent.dataTransfer.files).map(file => { promise = Promise.all(Array.from(dropEvent.dataTransfer.files).map(file => {
var filePath = file.path var filePath = file.path
if (file.type.startsWith('image')) { if (file.type.startsWith('image')) {
var a = getOrientation(file)
if (file.type === 'image/gif' || file.type === 'image/svg+xml') { if (file.type === 'image/gif' || file.type === 'image/svg+xml') {
return copyAttachment(file.path, storageKey, noteKey).then(fileName => ({ return copyAttachment(file.path, storageKey, noteKey).then(fileName => ({
fileName, fileName,
@@ -290,7 +289,7 @@ function handleAttachmentDrop(codeEditor, storageKey, noteKey, dropEvent) {
} else { } else {
return getOrientation(file) return getOrientation(file)
.then((orientation) => { .then((orientation) => {
if (orientation === -1) { if (orientation === -1) { // The image rotation is correct and does not need adjustment
return copyAttachment(file.path, storageKey, noteKey) return copyAttachment(file.path, storageKey, noteKey)
} else { } else {
return fixRotate(file).then(data => copyAttachment({ return fixRotate(file).then(data => copyAttachment({