@social-mail/social-mail-web-server 1.4.727 → 1.4.729
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 +7 -3
- 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 +6 -2
package/package.json
CHANGED
|
@@ -391,7 +391,7 @@ export default class SnapshotService {
|
|
|
391
391
|
const url = new URL(link, "https://a");
|
|
392
392
|
const tokens = url.pathname.substring(1).split("/");
|
|
393
393
|
const fileID = tokens[5];
|
|
394
|
-
const fileContent = await this.downloadFileContent(fileID);
|
|
394
|
+
const fileContent = await this.downloadFileContent(fileID, link);
|
|
395
395
|
e.parentElement.replaceChildren(...fileContent);
|
|
396
396
|
updated = true;
|
|
397
397
|
}
|
|
@@ -451,9 +451,13 @@ export default class SnapshotService {
|
|
|
451
451
|
}
|
|
452
452
|
|
|
453
453
|
@cacheFor()
|
|
454
|
-
async downloadFileContent(fileID) {
|
|
454
|
+
async downloadFileContent(fileID, link) {
|
|
455
455
|
const file = await this.db.appFiles.where({ fileID }, (p) => (x) => x.appFileID === p.fileID)
|
|
456
|
+
.include((x) => x.fileContent)
|
|
456
457
|
.first();
|
|
458
|
+
if (!file?.fileContent) {
|
|
459
|
+
console.error(`File ${fileID} not found for ${link}`);
|
|
460
|
+
}
|
|
457
461
|
const localFile = await this.tempFileService.downloadAppFile(file);
|
|
458
462
|
const text = await localFile.readAsText();
|
|
459
463
|
await localFile.delete();
|