Merge pull request #89 from ente-io/fix-stack-overflow-issue
Fix stack overflow issue
This commit is contained in:
commit
2ce6dc63c3
|
@ -18,7 +18,10 @@ export const getPendingUploads = async () => {
|
|||
if (zipPaths.length) {
|
||||
type = FILE_PATH_TYPE.ZIPS;
|
||||
for (const zipPath of zipPaths) {
|
||||
files.push(...(await getElectronFilesFromGoogleZip(zipPath)));
|
||||
files = [
|
||||
...files,
|
||||
...(await getElectronFilesFromGoogleZip(zipPath)),
|
||||
];
|
||||
}
|
||||
const pendingFilePaths = new Set(filePaths);
|
||||
files = files.filter((file) => pendingFilePaths.has(file.path));
|
||||
|
@ -62,10 +65,13 @@ export const showUploadZipDialog = async () => {
|
|||
const filePaths: string[] = await ipcRenderer.invoke(
|
||||
'show-upload-zip-dialog'
|
||||
);
|
||||
const files: ElectronFile[] = [];
|
||||
let files: ElectronFile[] = [];
|
||||
|
||||
for (const filePath of filePaths) {
|
||||
files.push(...(await getElectronFilesFromGoogleZip(filePath)));
|
||||
files = [
|
||||
...files,
|
||||
...(await getElectronFilesFromGoogleZip(filePath)),
|
||||
];
|
||||
}
|
||||
|
||||
return {
|
||||
|
|
|
@ -16,7 +16,7 @@ export const getDirFilePaths = async (dirPath: string) => {
|
|||
|
||||
for (const filePath of filePaths) {
|
||||
const absolute = path.join(dirPath, filePath);
|
||||
files = files.concat(await getDirFilePaths(absolute));
|
||||
files = [...files, ...(await getDirFilePaths(absolute))];
|
||||
}
|
||||
|
||||
return files;
|
||||
|
|
|
@ -69,7 +69,7 @@ export default function setupIpcComs(
|
|||
|
||||
let files: string[] = [];
|
||||
for (const dirPath of dir.filePaths) {
|
||||
files = files.concat(await getDirFilePaths(dirPath));
|
||||
files = [...files, ...(await getDirFilePaths(dirPath))];
|
||||
}
|
||||
|
||||
return files;
|
||||
|
|
2
ui
2
ui
|
@ -1 +1 @@
|
|||
Subproject commit e7efe81966ef2224438a868754480b198642b638
|
||||
Subproject commit 3a97760ddec5f14761cd73553ad33c628a5f4eab
|
Loading…
Reference in a new issue