Merge pull request #89 from ente-io/fix-stack-overflow-issue

Fix stack overflow issue
This commit is contained in:
Abhinav Kumar 2022-10-22 13:44:42 +05:30 committed by GitHub
commit 2ce6dc63c3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 6 deletions

View file

@ -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 {

View file

@ -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;

View file

@ -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

@ -1 +1 @@
Subproject commit e7efe81966ef2224438a868754480b198642b638
Subproject commit 3a97760ddec5f14761cd73553ad33c628a5f4eab