mirror of
https://github.com/gristlabs/grist-core.git
synced 2024-10-27 20:44:07 +00:00
(core) Fix reporting of blank attachment types
Summary: The conditions in the map/filter of attachments was faulty, causing blank attachment types to slip through. Test Plan: Tested manually. Reviewers: jarek Reviewed By: jarek Differential Revision: https://phab.getgrist.com/D3865
This commit is contained in:
parent
b15ae98349
commit
c077f3c304
@ -2326,8 +2326,9 @@ export class ActiveDoc extends EventEmitter {
|
||||
const attachments = this.docData?.getMetaTable('_grist_Attachments');
|
||||
const numAttachments = attachments?.numRecords() ?? 0;
|
||||
const attachmentTypes = attachments?.getRecords()
|
||||
.map(r => r.fileExt?.slice(1) ?? null)
|
||||
.filter(ext => ext !== null);
|
||||
// Exclude the leading ".", if any.
|
||||
.map(r => r.fileExt?.trim()?.slice(1))
|
||||
.filter(ext => Boolean(ext));
|
||||
|
||||
return {
|
||||
numAttachments,
|
||||
|
Loading…
Reference in New Issue
Block a user