Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions src/renderer/DragAndDrop.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
import * as R from 'ramda'
import util from 'util'
import { promises as fs } from 'fs'
import path from 'path'
import { reproject } from 'reproject'
import Emitter from '../shared/emitter'
import * as ID from './ids'
import { CONTENT_TYPE } from './Clipboard'
import { clone } from './model/Import'

const readJSON = async path => {
const content = await fs.readFile(path, 'utf8')
const readJSON = async file => {
const content = await file.text()
return JSON.parse(content)
}

Expand Down Expand Up @@ -46,7 +45,7 @@ DragAndDrop.prototype.drop = async function (event) {

DragAndDrop.prototype.json = async function (files) {

const geoJSON = await Promise.all(files.map(file => readJSON(file.path)))
const geoJSON = await Promise.all(files.map(file => readJSON(file)))

/* treat dropped files the same way as if they were copied/pasted */
const natives = geoJSON.filter(json => json.contentType === CONTENT_TYPE)
Expand Down