stream-chat-react 12.15.0 → 12.15.1

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.
@@ -44406,10 +44406,12 @@ var useSubmitHandler = (props, state, dispatch, numberOfUploads, enrichURLsContr
44406
44406
  if (someAttachmentsUploading) {
44407
44407
  return addNotification(t2("Wait until all attachments have uploaded"), "error");
44408
44408
  }
44409
- const attachmentsFromUploads = attachments.filter(
44410
- (att) => att.localMetadata?.uploadState !== "failed" || findAndEnqueueURLsToEnrich && !att.og_scrape_url
44411
- // filter out all the attachments scraped before the message was edited
44412
- ).map((localAttachment) => {
44409
+ const attachmentsWithoutLinkPreviews = attachments.filter((att) => {
44410
+ const isSuccessfulUpload = att.localMetadata?.uploadState === "finished";
44411
+ const isNotUpload = !att.localMetadata?.uploadState;
44412
+ const isNotLinkPreview = !att.og_scrape_url;
44413
+ return isNotLinkPreview && (isSuccessfulUpload || isNotUpload);
44414
+ }).map((localAttachment) => {
44413
44415
  const { localMetadata: _, ...attachment } = localAttachment;
44414
44416
  return attachment;
44415
44417
  });
@@ -44423,17 +44425,16 @@ var useSubmitHandler = (props, state, dispatch, numberOfUploads, enrichURLsContr
44423
44425
  const someLinkPreviewsDismissed = Array.from(linkPreviews.values()).some(
44424
44426
  (linkPreview) => linkPreview.state === "dismissed" /* DISMISSED */
44425
44427
  );
44426
- attachmentsFromLinkPreviews = someLinkPreviewsLoading ? [] : Array.from(linkPreviews.values()).filter(
44427
- (linkPreview) => linkPreview.state === "loaded" /* LOADED */ && !attachmentsFromUploads.find(
44428
- (attFromUpload) => attFromUpload.og_scrape_url === linkPreview.og_scrape_url
44429
- )
44430
- ).map(
44428
+ attachmentsFromLinkPreviews = someLinkPreviewsLoading ? [] : Array.from(linkPreviews.values()).filter((linkPreview) => linkPreview.state === "loaded" /* LOADED */).map(
44431
44429
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
44432
44430
  ({ state: linkPreviewState, ...ogAttachment }) => ogAttachment
44433
44431
  );
44434
44432
  sendOptions.skip_enrich_url = !someLinkPreviewsLoading && attachmentsFromLinkPreviews.length > 0 || someLinkPreviewsDismissed;
44435
44433
  }
44436
- const newAttachments = [...attachmentsFromUploads, ...attachmentsFromLinkPreviews];
44434
+ const newAttachments = [
44435
+ ...attachmentsWithoutLinkPreviews,
44436
+ ...attachmentsFromLinkPreviews
44437
+ ];
44437
44438
  const actualMentionedUsers = Array.from(
44438
44439
  new Set(
44439
44440
  mentioned_users.filter(
@@ -51067,7 +51068,7 @@ var PollOptionWithLatestVotes = ({
51067
51068
  // src/components/Poll/PollActions/PollResults/PollResults.tsx
51068
51069
  var pollStateSelector10 = (nextValue) => ({
51069
51070
  name: nextValue.name,
51070
- options: nextValue.options,
51071
+ options: [...nextValue.options],
51071
51072
  vote_counts_by_option: nextValue.vote_counts_by_option
51072
51073
  });
51073
51074
  var PollResults = ({
@@ -57783,7 +57784,7 @@ var useChat = ({
57783
57784
  };
57784
57785
  (0, import_react261.useEffect)(() => {
57785
57786
  if (!client) return;
57786
- const version = "12.15.0";
57787
+ const version = "12.15.1";
57787
57788
  const userAgent = client.getUserAgent();
57788
57789
  if (!userAgent.includes("stream-chat-react")) {
57789
57790
  client.setUserAgent(`stream-chat-react-${version}-${userAgent}`);