aboutsummaryrefslogtreecommitdiff
path: root/src/fields/Doc.ts
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2025-03-25 22:58:35 -0400
committerbobzel <zzzman@gmail.com>2025-03-25 22:58:35 -0400
commit9e0f2fc211f4e12cfe6c6cdb3b113de5af2dbfe6 (patch)
treeba1bf73d4edb294d86db9b919cc299c471e29c4a /src/fields/Doc.ts
parent29a1fe16297c99ddbed7974b7c602294da9a311d (diff)
fixed sizing and background of collection filter button. fixed exception in getDescription for text labels.
Diffstat (limited to 'src/fields/Doc.ts')
-rw-r--r--src/fields/Doc.ts2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/fields/Doc.ts b/src/fields/Doc.ts
index 803e4cac0..76d302db7 100644
--- a/src/fields/Doc.ts
+++ b/src/fields/Doc.ts
@@ -1480,7 +1480,7 @@ export namespace Doc {
case DocumentType.PDF: return curDescription || StrCast(tdoc.text).split(/\s+/).slice(0, 50).join(' '); // first 50 words of pdf text
case DocumentType.IMG: return curDescription || imageUrlToBase64(ImageCastWithSuffix(Doc.LayoutField(tdoc), '_o') ?? '')
.then(hrefBase64 => gptImageLabel(hrefBase64, 'Give three to five labels to describe this image.'));
- case DocumentType.RTF: return RTFCast(tdoc[Doc.LayoutFieldKey(tdoc)]).Text;
+ case DocumentType.RTF: return RTFCast(tdoc[Doc.LayoutFieldKey(tdoc)])?.Text ?? StrCast(tdoc[Doc.LayoutFieldKey(tdoc)]);
default: return StrCast(tdoc.title).startsWith("Untitled") ? "" : StrCast(tdoc.title);
}}); // prettier-ignore
return docText(doc).then(text => (doc['$' + Doc.LayoutFieldKey(doc) + '_description'] = text));