mirror of
https://github.com/penpot/penpot.git
synced 2025-07-29 02:27:19 +02:00
🐛 Check data type when reading d&d data
This commit is contained in:
parent
04f829eba3
commit
68798522af
1 changed files with 5 additions and 1 deletions
|
@ -8,6 +8,7 @@
|
|||
(ns uxbox.util.dom.dnd
|
||||
"Drag & Drop interop helpers."
|
||||
(:require
|
||||
[cuerdas.core :as str]
|
||||
[uxbox.util.data :refer (read-string)]
|
||||
[uxbox.util.transit :as t]))
|
||||
|
||||
|
@ -77,7 +78,10 @@
|
|||
(get-data e "uxbox/data"))
|
||||
([e data-type]
|
||||
(let [dt (.-dataTransfer e)]
|
||||
(t/decode (.getData dt data-type)))))
|
||||
(if (or (str/starts-with? data-type "uxbox")
|
||||
(= data-type "application/json"))
|
||||
(t/decode (.getData dt data-type))
|
||||
(.getData dt data-type)))))
|
||||
|
||||
(defn get-files
|
||||
[e]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue