@social-mail/social-mail-web-server 1.4.729 → 1.4.730
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 +1 -1
- package/dist/server/services/files/SnapshotService.d.ts.map +1 -1
- package/dist/server/services/files/SnapshotService.js +8 -6
- 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 +8 -5
package/package.json
CHANGED
|
@@ -390,8 +390,8 @@ export default class SnapshotService {
|
|
|
390
390
|
// get file content...
|
|
391
391
|
const url = new URL(link, "https://a");
|
|
392
392
|
const tokens = url.pathname.substring(1).split("/");
|
|
393
|
-
const
|
|
394
|
-
const fileContent = await this.
|
|
393
|
+
const fileContentID = tokens[5];
|
|
394
|
+
const fileContent = await this.downloadSnapshotContent(fileContentID, link);
|
|
395
395
|
e.parentElement.replaceChildren(...fileContent);
|
|
396
396
|
updated = true;
|
|
397
397
|
}
|
|
@@ -451,12 +451,15 @@ export default class SnapshotService {
|
|
|
451
451
|
}
|
|
452
452
|
|
|
453
453
|
@cacheFor()
|
|
454
|
-
async
|
|
455
|
-
const
|
|
454
|
+
async downloadSnapshotContent(fileContentID, link) {
|
|
455
|
+
const path = `${this.snapshotRoot.appFileID}/%`;
|
|
456
|
+
const file = await this.db.appFiles.where({ path, fileContentID }, (p) => (x) => Sql.text.like(x.path, p.path)
|
|
457
|
+
&& x.fileContentID === p.fileContentID
|
|
458
|
+
)
|
|
456
459
|
.include((x) => x.fileContent)
|
|
457
460
|
.first();
|
|
458
461
|
if (!file?.fileContent) {
|
|
459
|
-
console.error(`File ${
|
|
462
|
+
console.error(`File ${fileContentID} not found for ${link}`);
|
|
460
463
|
}
|
|
461
464
|
const localFile = await this.tempFileService.downloadAppFile(file);
|
|
462
465
|
const text = await localFile.readAsText();
|