From 7b2d7b8aa5980047e6defd86b0829b6d4aea5c74 Mon Sep 17 00:00:00 2001 From: Elio Struyf Date: Tue, 5 Oct 2021 09:12:03 +0200 Subject: [PATCH] #132 - Drag and drop fix --- src/commands/Dashboard.ts | 6 +++++- src/dashboardWebView/components/Media/Media.tsx | 2 -- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/commands/Dashboard.ts b/src/commands/Dashboard.ts index ba3aa064..c06677c6 100644 --- a/src/commands/Dashboard.ts +++ b/src/commands/Dashboard.ts @@ -507,7 +507,11 @@ export class Dashboard { const wsFolder = Folders.getWorkspaceFolder(); const staticFolder = SettingsHelper.get(SETTINGS_CONTENT_STATIC_FOLDER); const wsPath = wsFolder ? wsFolder.fsPath : ""; - let absFolderPath = join(wsPath, staticFolder || "", folder || ""); + let absFolderPath = join(wsPath, staticFolder || ""); + + if (folder) { + absFolderPath = folder; + } if (!existsSync(absFolderPath)) { absFolderPath = join(wsPath, folder || ""); diff --git a/src/dashboardWebView/components/Media/Media.tsx b/src/dashboardWebView/components/Media/Media.tsx index dc52082d..7fa0c634 100644 --- a/src/dashboardWebView/components/Media/Media.tsx +++ b/src/dashboardWebView/components/Media/Media.tsx @@ -16,8 +16,6 @@ import { useDropzone } from 'react-dropzone' import { useCallback } from 'react'; import { DashboardMessage } from '../../DashboardMessage'; import { FrontMatterIcon } from '../../../panelWebView/components/Icons/FrontMatterIcon'; -import { FolderIcon } from '@heroicons/react/solid'; -import { basename } from 'path'; import { FolderItem } from './FolderItem'; export interface IMediaProps {}