@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/dist/server/services/files/SnapshotService.d.ts +0 -1
- package/dist/server/services/files/SnapshotService.d.ts.map +1 -1
- package/dist/server/services/files/SnapshotService.js +10 -9
- package/dist/server/services/files/SnapshotService.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/server/services/files/SnapshotService.ts +10 -12
package/package.json
CHANGED
|
@@ -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
|
-
|
|
73
|
-
|
|
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
|
}
|