diff options
| author | bobzel <zzzman@gmail.com> | 2022-03-22 11:32:47 -0400 |
|---|---|---|
| committer | bobzel <zzzman@gmail.com> | 2022-03-22 11:32:47 -0400 |
| commit | 810f86195188503b04d64f9d58ea4dfc3a639398 (patch) | |
| tree | 2e0f252147dd65f36069426df4fe5369423427dc /src/client/util/Import & Export/DirectoryImportBox.tsx | |
| parent | 0885f2b6ea10bdc54f587040ea8e6dc90ef5b0f3 (diff) | |
fixed temporal media merge that had reverted a lot of things.
Diffstat (limited to 'src/client/util/Import & Export/DirectoryImportBox.tsx')
| -rw-r--r-- | src/client/util/Import & Export/DirectoryImportBox.tsx | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/client/util/Import & Export/DirectoryImportBox.tsx b/src/client/util/Import & Export/DirectoryImportBox.tsx index 925b74efa..39e9251a5 100644 --- a/src/client/util/Import & Export/DirectoryImportBox.tsx +++ b/src/client/util/Import & Export/DirectoryImportBox.tsx @@ -1,9 +1,8 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { BatchedArray } from "array-batcher"; -import "fs"; import { action, computed, IReactionDisposer, observable, reaction, runInAction } from "mobx"; import { observer } from "mobx-react"; -import * as path from 'path'; +import { extname } from "path"; import Measure, { ContentRect } from "react-measure"; import { Doc, DocListCast, DocListCastAsync, Opt } from "../../../fields/Doc"; import { Id } from "../../../fields/FieldSymbols"; @@ -86,7 +85,7 @@ export class DirectoryImportBox extends React.Component<FieldViewProps> { for (let i = 0; i < files.length; i++) { const file = files.item(i); if (file && !unsupported.includes(file.type)) { - const ext = path.extname(file.name).toLowerCase(); + const ext = extname(file.name).toLowerCase(); if (AcceptableMedia.imageFormats.includes(ext)) { validated.push(file); } @@ -120,7 +119,7 @@ export class DirectoryImportBox extends React.Component<FieldViewProps> { } const { accessPaths, exifData } = result; const path = Utils.prepend(accessPaths.agnostic.client); - const document = await DocUtils.DocumentFromType(type, path, { _width: 300, title: name }); + const document = type && await DocUtils.DocumentFromType(type, path, { _width: 300 }); const { data, error } = exifData; if (document) { Doc.GetProto(document).exif = error || Doc.Get.FromJson({ data }); |
