Skip to content

Commit

Permalink
Utilise l'extension pour deviner le type de fichier au drag n drop
Browse files Browse the repository at this point in the history
car file.type est vide sous Chrome + Windows
  • Loading branch information
totakoko committed Feb 11, 2025
1 parent f86968c commit 0f957c7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/Map/components/FileDragNDrop.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const FileDragNDrop = () => {
const file = event.dataTransfer?.files[0];
setDragging(false);

if (file && (file.type === 'application/geo+json' || file.type === 'application/json')) {
if (file && file.name.endsWith('json')) {
const reader = new FileReader();
reader.onload = async (e) => {
try {
Expand Down

0 comments on commit 0f957c7

Please sign in to comment.