@overmap-ai/core 1.0.44-tiptap.5 → 1.0.44-tiptap.6

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.
@@ -1674,8 +1674,14 @@ var __publicField = (obj, key, value) => {
1674
1674
  [selectAllComponentAttachments, (_state, componentId) => componentId],
1675
1675
  (attachments, componentId) => {
1676
1676
  const attachmentsOfComponent = attachments.filter(({ component_id }) => componentId === component_id);
1677
- const fileAttachments = attachmentsOfComponent.filter(({ file_type }) => !file_type.startsWith("image/"));
1678
- const imageAttachments = attachmentsOfComponent.filter(({ file_type }) => file_type.startsWith("image/"));
1677
+ const fileAttachments = attachmentsOfComponent.filter(
1678
+ // this null check here is necessary, there are cases where file_type is null or undefined
1679
+ ({ file_type }) => !file_type || !file_type.startsWith("image/")
1680
+ );
1681
+ const imageAttachments = attachmentsOfComponent.filter(
1682
+ // this null check here is necessary, there are cases where file_type is null or undefined
1683
+ ({ file_type }) => file_type && file_type.startsWith("image/")
1684
+ );
1679
1685
  return { fileAttachments, imageAttachments };
1680
1686
  }
1681
1687
  )
@@ -1940,8 +1946,14 @@ var __publicField = (obj, key, value) => {
1940
1946
  const attachmentsOfComponent = attachments.filter(
1941
1947
  ({ component_type_id }) => component_type_id === componentTypeId
1942
1948
  );
1943
- const fileAttachments = attachmentsOfComponent.filter(({ file_type }) => !file_type.startsWith("image/"));
1944
- const imageAttachments = attachmentsOfComponent.filter(({ file_type }) => file_type.startsWith("image/"));
1949
+ const fileAttachments = attachmentsOfComponent.filter(
1950
+ // this null check here is necessary, there are cases where file_type is null or undefined
1951
+ ({ file_type }) => !file_type || !file_type.startsWith("image/")
1952
+ );
1953
+ const imageAttachments = attachmentsOfComponent.filter(
1954
+ // this null check here is necessary, there are cases where file_type is null or undefined
1955
+ ({ file_type }) => file_type && file_type.startsWith("image/")
1956
+ );
1945
1957
  return { fileAttachments, imageAttachments };
1946
1958
  }
1947
1959
  )
@@ -2241,8 +2253,14 @@ var __publicField = (obj, key, value) => {
2241
2253
  [selectIssueAttachments, (_state, issueId) => issueId],
2242
2254
  (attachments, issueId) => {
2243
2255
  const attachmentsOfComponent = attachments.filter(({ issue_id }) => issue_id === issueId);
2244
- const fileAttachments = attachmentsOfComponent.filter(({ file_type }) => !file_type.startsWith("image/"));
2245
- const imageAttachments = attachmentsOfComponent.filter(({ file_type }) => file_type.startsWith("image/"));
2256
+ const fileAttachments = attachmentsOfComponent.filter(
2257
+ // this null check here is necessary, there are cases where file_type is null or undefined
2258
+ ({ file_type }) => !file_type || !file_type.startsWith("image/")
2259
+ );
2260
+ const imageAttachments = attachmentsOfComponent.filter(
2261
+ // this null check here is necessary, there are cases where file_type is null or undefined
2262
+ ({ file_type }) => file_type && file_type.startsWith("image/")
2263
+ );
2246
2264
  return { fileAttachments, imageAttachments };
2247
2265
  }
2248
2266
  )