@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.
@@ -1684,8 +1684,14 @@ const selectAttachmentsOfComponentByType = restructureCreateSelectorWithArgs(
1684
1684
  [selectAllComponentAttachments, (_state, componentId) => componentId],
1685
1685
  (attachments, componentId) => {
1686
1686
  const attachmentsOfComponent = attachments.filter(({ component_id }) => componentId === component_id);
1687
- const fileAttachments = attachmentsOfComponent.filter(({ file_type }) => !file_type.startsWith("image/"));
1688
- const imageAttachments = attachmentsOfComponent.filter(({ file_type }) => file_type.startsWith("image/"));
1687
+ const fileAttachments = attachmentsOfComponent.filter(
1688
+ // this null check here is necessary, there are cases where file_type is null or undefined
1689
+ ({ file_type }) => !file_type || !file_type.startsWith("image/")
1690
+ );
1691
+ const imageAttachments = attachmentsOfComponent.filter(
1692
+ // this null check here is necessary, there are cases where file_type is null or undefined
1693
+ ({ file_type }) => file_type && file_type.startsWith("image/")
1694
+ );
1689
1695
  return { fileAttachments, imageAttachments };
1690
1696
  }
1691
1697
  )
@@ -1950,8 +1956,14 @@ const selectAttachmentsOfComponentTypeByType = restructureCreateSelectorWithArgs
1950
1956
  const attachmentsOfComponent = attachments.filter(
1951
1957
  ({ component_type_id }) => component_type_id === componentTypeId
1952
1958
  );
1953
- const fileAttachments = attachmentsOfComponent.filter(({ file_type }) => !file_type.startsWith("image/"));
1954
- const imageAttachments = attachmentsOfComponent.filter(({ file_type }) => file_type.startsWith("image/"));
1959
+ const fileAttachments = attachmentsOfComponent.filter(
1960
+ // this null check here is necessary, there are cases where file_type is null or undefined
1961
+ ({ file_type }) => !file_type || !file_type.startsWith("image/")
1962
+ );
1963
+ const imageAttachments = attachmentsOfComponent.filter(
1964
+ // this null check here is necessary, there are cases where file_type is null or undefined
1965
+ ({ file_type }) => file_type && file_type.startsWith("image/")
1966
+ );
1955
1967
  return { fileAttachments, imageAttachments };
1956
1968
  }
1957
1969
  )
@@ -2251,8 +2263,14 @@ const selectAttachmentsOfIssueByType = restructureCreateSelectorWithArgs(
2251
2263
  [selectIssueAttachments, (_state, issueId) => issueId],
2252
2264
  (attachments, issueId) => {
2253
2265
  const attachmentsOfComponent = attachments.filter(({ issue_id }) => issue_id === issueId);
2254
- const fileAttachments = attachmentsOfComponent.filter(({ file_type }) => !file_type.startsWith("image/"));
2255
- const imageAttachments = attachmentsOfComponent.filter(({ file_type }) => file_type.startsWith("image/"));
2266
+ const fileAttachments = attachmentsOfComponent.filter(
2267
+ // this null check here is necessary, there are cases where file_type is null or undefined
2268
+ ({ file_type }) => !file_type || !file_type.startsWith("image/")
2269
+ );
2270
+ const imageAttachments = attachmentsOfComponent.filter(
2271
+ // this null check here is necessary, there are cases where file_type is null or undefined
2272
+ ({ file_type }) => file_type && file_type.startsWith("image/")
2273
+ );
2256
2274
  return { fileAttachments, imageAttachments };
2257
2275
  }
2258
2276
  )