@social-mail/social-mail-web-server 1.9.15 → 1.9.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@social-mail/social-mail-web-server",
3
- "version": "1.9.15",
3
+ "version": "1.9.16",
4
4
  "description": "## Phase 1",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -42,8 +42,6 @@ export default class SnapshotService
42
42
 
43
43
  allFiles: AppFile[] = null;
44
44
 
45
- fileMap = new Map<number, any>();
46
-
47
45
  snapshotSize: number = 0;
48
46
 
49
47
  [Symbol.dispose]() {
@@ -69,12 +67,18 @@ export default class SnapshotService
69
67
  throw new EntityAccessError(`File not found under ${sourcePath}/`);
70
68
  }
71
69
 
72
- for (const iterator of this.allFiles) {
73
- this.fileMap.set(iterator.appFileID, iterator);
70
+ let folder: AppFile;
71
+ for (const file of this.allFiles) {
72
+ if (file.appFileID === folderID) {
73
+ folder = file;
74
+ continue;
75
+ }
76
+ if (file.isFolder) {
77
+ continue;
78
+ }
79
+ this.snapshotSize += file.fileSize;
74
80
  }
75
81
 
76
- const folder = this.fileMap.get(folderID);
77
-
78
82
 
79
83
  const dateCreated = DateTime.now;
80
84
  const dateUpdated = dateCreated;
@@ -124,8 +128,6 @@ export default class SnapshotService
124
128
  async copyChildren(db: SocialMailContext, source: AppFile, dest: AppFile, siteRoot = "") {
125
129
  const { dateCreated, dateUpdated } = dest;
126
130
 
127
- dest.children = [];
128
-
129
131
  if (!source.children) {
130
132
  return;
131
133
  }
@@ -144,8 +146,6 @@ export default class SnapshotService
144
146
  dateUpdated
145
147
  });
146
148
 
147
- dest.children.push(destChild);
148
-
149
149
  const path = `${dest.path}${destChild.appFileID}/`;
150
150
  destChild.path = path;
151
151
  await db.appFiles.statements.update({
@@ -157,8 +157,6 @@ export default class SnapshotService
157
157
 
158
158
  if (srcChild.isFolder) {
159
159
  await this.copyChildren(db, srcChild, destChild, siteRoot + "/" + srcChild.name );
160
- } else {
161
- this.snapshotSize += Number(srcChild.fileSize);
162
160
  }
163
161
  }
164
162
  }