From 16e663f807c77c56e64c23689dfdb7000fb2d0e9 Mon Sep 17 00:00:00 2001
From: bobzel <zzzman@gmail.com>
Date: Thu, 13 Aug 2020 21:34:58 -0400
Subject: fixed warnings.

---
 src/client/views/MainView.tsx | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

(limited to 'src/client/views/MainView.tsx')

diff --git a/src/client/views/MainView.tsx b/src/client/views/MainView.tsx
index d0f543d16..db5325713 100644
--- a/src/client/views/MainView.tsx
+++ b/src/client/views/MainView.tsx
@@ -45,7 +45,6 @@ import { ANTIMODEMENU_HEIGHT, SEARCH_PANEL_HEIGHT } from './globalCssVariables.s
 import KeyManager from './GlobalKeyHandler';
 import { LinkMenu } from './linking/LinkMenu';
 import "./MainView.scss";
-import { MainViewNotifs } from './MainViewNotifs';
 import { AudioBox } from './nodes/AudioBox';
 import { DocumentLinksButton } from './nodes/DocumentLinksButton';
 import { DocumentView } from './nodes/DocumentView';
@@ -895,7 +894,7 @@ export class MainView extends React.Component {
     }
 
     importDocument = () => {
-        const sidebar = Cast(Doc.UserDoc()["sidebar-import-documents"], Doc, null) as Doc;
+        const sidebar = Cast(Doc.UserDoc()["sidebar-import-documents"], Doc, null);
         const sidebarDocView = DocumentManager.Instance.getDocumentView(sidebar);
         const input = document.createElement("input");
         input.type = "file";
@@ -923,9 +922,8 @@ export class MainView extends React.Component {
                     }
                 }
             } else if (input.files && input.files.length !== 0) {
-                const files: FileList | null = input.files;
-                for (let i = 0; i < files.length; i++) {
-                    const file = files[i];
+                const files = input.files || [];
+                Array.from(files).forEach(async file => {
                     const res = await Networking.UploadFilesToServer(file);
                     res.map(async ({ result }) => {
                         const name = file.name;
@@ -962,7 +960,7 @@ export class MainView extends React.Component {
                             else pending.data = new List([doc]);
                         }
                     });
-                }
+                });
             } else {
                 console.log("No file selected");
             }
-- 
cgit v1.2.3-70-g09d2

