Skip to content

Commit

Permalink
fix: upload issue
Browse files Browse the repository at this point in the history
  • Loading branch information
eole1712 committed Sep 29, 2021
1 parent ab803d9 commit 74cbec2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/altair-app/src/app/modules/altair/utils/index.ts
Expand Up @@ -78,6 +78,7 @@ export const openFile = async (opts: FileDialogOptions = {}) => {
};

export const getFileContent = async (file: File) => {
console.log(file);
return new Promise<string>((resolve, reject) => {
const fileReader = new FileReader();
fileReader.onload = function (e: any) {
Expand All @@ -94,7 +95,7 @@ export const openFiles = async (opts: FileDialogOptions = {}) => {
try {
const files = await fileDialog({ ...opts, multiple: true });

return Promise.all(Array.from(Array(files.length).map((_, i) => getFileContent(files[i]))));
return Promise.all(Array.from(Array(files.length)).map((_, i) => getFileContent(files[i])));
} catch (err) {
debug.log('There was an issue while opening the files: ', err);

Expand Down

0 comments on commit 74cbec2

Please sign in to comment.