From 731b083de439928e92e2f01dd0c3f38f31e0a9aa Mon Sep 17 00:00:00 2001 From: Steven Hugg Date: Sun, 8 Sep 2019 16:21:58 -0500 Subject: [PATCH] file upload asks you if you want to upload --- src/ui.ts | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/ui.ts b/src/ui.ts index 9b63f61f..e15f0284 100644 --- a/src/ui.ts +++ b/src/ui.ts @@ -380,9 +380,18 @@ function handleFileUpload(files: File[]) { function uploadNextFile() { var f = files[index++]; if (!f) { - console.log("Done uploading"); - updateSelector(); - alertInfo("Files uploaded. Use the Project Selector if you want to load an uploaded file as a project."); + console.log("Done uploading", index); + if (index > 2) { + alertInfo("Files uploaded."); + setTimeout(updateSelector, 1000); // TODO: wait for files to upload + } else { + qs['file'] = files[0].name; + if (confirm("Open '" + qs['file'] + "' as project?")) { + gotoNewLocation(); + } else { + updateSelector(); + } + } gaEvent('workspace', 'file', 'upload'); } else { var path = f.name;