stream-chat 9.5.0 → 9.5.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.
@@ -5440,15 +5440,14 @@ var pollStateChangeValidators = {
5440
5440
  return { max_votes_allowed: "Type a number from 2 to 10" };
5441
5441
  return { max_votes_allowed: void 0 };
5442
5442
  },
5443
- options: ({ value }) => {
5443
+ options: ({ value: options }) => {
5444
5444
  const errors = {};
5445
5445
  const seenOptions = /* @__PURE__ */ new Set();
5446
- value.forEach((option) => {
5447
- const trimmedText = option.text.trim();
5448
- if (seenOptions.has(trimmedText)) {
5446
+ options.forEach((option) => {
5447
+ if (seenOptions.has(option.text) && option.text.length) {
5449
5448
  errors[option.id] = "Option already exists";
5450
5449
  } else {
5451
- seenOptions.add(trimmedText);
5450
+ seenOptions.add(option.text);
5452
5451
  }
5453
5452
  });
5454
5453
  return Object.keys(errors).length > 0 ? { options: errors } : { options: void 0 };
@@ -5801,13 +5800,13 @@ var PollComposer = class {
5801
5800
  }
5802
5801
  get canCreatePoll() {
5803
5802
  const { data, errors } = this.state.getLatestValue();
5804
- const hasAtLeastOneOption = data.options.filter((o) => !!o.text).length > 0;
5803
+ const hasAtLeastOneNonEmptyOption = data.options.filter((o) => !!o.text.trim()).length > 0;
5805
5804
  const hasName = !!data.name;
5806
5805
  const maxVotesAllowedNumber = parseInt(
5807
5806
  data.max_votes_allowed?.match(VALID_MAX_VOTES_VALUE_REGEX)?.[0] || ""
5808
5807
  );
5809
5808
  const validMaxVotesAllowed = data.max_votes_allowed === "" || !!maxVotesAllowedNumber && (2 <= maxVotesAllowedNumber || maxVotesAllowedNumber <= 10);
5810
- return hasAtLeastOneOption && hasName && validMaxVotesAllowed && Object.values(errors).filter((errorText) => !!errorText).length === 0;
5809
+ return hasAtLeastOneNonEmptyOption && hasName && validMaxVotesAllowed && Object.values(errors).filter((errorText) => !!errorText).length === 0;
5811
5810
  }
5812
5811
  };
5813
5812
 
@@ -14741,7 +14740,7 @@ var StreamChat = class _StreamChat {
14741
14740
  data
14742
14741
  );
14743
14742
  }
14744
- DBDeleteChannelType(channelType) {
14743
+ deleteChannelType(channelType) {
14745
14744
  return this.delete(
14746
14745
  this.baseURL + `/channeltypes/${encodeURIComponent(channelType)}`
14747
14746
  );
@@ -15084,7 +15083,7 @@ var StreamChat = class _StreamChat {
15084
15083
  if (this.userAgent) {
15085
15084
  return this.userAgent;
15086
15085
  }
15087
- const version = "9.5.0";
15086
+ const version = "9.5.1";
15088
15087
  const clientBundle = "browser-cjs";
15089
15088
  let userAgentString = "";
15090
15089
  if (this.sdkIdentifier) {