1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-13 05:19:58 +00:00

Avoid optional chaining syntax

So that we can run on older Node.js versions
This commit is contained in:
Jeremy Ruston 2024-09-11 19:22:29 +01:00
parent b698b3e9cf
commit 4050ba5f92

View File

@ -159,7 +159,7 @@ SqlTiddlerStore.prototype.processIncomingTiddler = function(tiddlerFields, exist
if(fileSize <= attachmentSizeLimit) { if(fileSize <= attachmentSizeLimit) {
const existingAttachmentMeta = this.attachmentStore.getAttachmentMetadata(existing_attachment_blob); const existingAttachmentMeta = this.attachmentStore.getAttachmentMetadata(existing_attachment_blob);
const hasCanonicalField = !!tiddlerFields._canonical_uri; const hasCanonicalField = !!tiddlerFields._canonical_uri;
const skipAttachment = hasCanonicalField && (tiddlerFields._canonical_uri === (existingAttachmentMeta?._canonical_uri || existing_canonical_uri)); const skipAttachment = hasCanonicalField && (tiddlerFields._canonical_uri === (existingAttachmentMeta ? existingAttachmentMeta._canonical_uri : existing_canonical_uri));
shouldProcessAttachment = !skipAttachment; shouldProcessAttachment = !skipAttachment;
} else { } else {
shouldProcessAttachment = false; shouldProcessAttachment = false;
@ -174,7 +174,7 @@ SqlTiddlerStore.prototype.processIncomingTiddler = function(tiddlerFields, exist
_canonical_uri: tiddlerFields._canonical_uri _canonical_uri: tiddlerFields._canonical_uri
}); });
if(tiddlerFields?._canonical_uri) { if(tiddlerFields && tiddlerFields._canonical_uri) {
delete tiddlerFields._canonical_uri; delete tiddlerFields._canonical_uri;
} }