stream-chat 9.50.1 → 9.50.2

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.
@@ -3668,7 +3668,8 @@ var _AttachmentManager = class _AttachmentManager {
3668
3668
  return attachment;
3669
3669
  };
3670
3670
  this.uploadFiles = async (files) => {
3671
- if (!this.isUploadEnabled) return;
3671
+ if (this.hasCustomDoUploadRequest && !this.hasAvailableUploadSlots || !this.hasCustomDoUploadRequest && !this.isUploadEnabled)
3672
+ return;
3672
3673
  const iterableFiles = isFileList(files) ? Array.from(files) : files;
3673
3674
  return await Promise.all(
3674
3675
  iterableFiles.slice(0, this.availableUploadSlots).map(this.uploadFile)
@@ -3737,8 +3738,14 @@ var _AttachmentManager = class _AttachmentManager {
3737
3738
  get hasUploadPermission() {
3738
3739
  return !!this.channel.data?.own_capabilities?.includes("upload-file");
3739
3740
  }
3741
+ get hasCustomDoUploadRequest() {
3742
+ return typeof this.config.doUploadRequest === "function";
3743
+ }
3744
+ get hasAvailableUploadSlots() {
3745
+ return this.availableUploadSlots > 0;
3746
+ }
3740
3747
  get isUploadEnabled() {
3741
- return this.hasUploadPermission && this.availableUploadSlots > 0;
3748
+ return this.hasUploadPermission && this.hasAvailableUploadSlots;
3742
3749
  }
3743
3750
  get successfulUploads() {
3744
3751
  return this.getUploadsByState("finished");
@@ -14874,7 +14881,7 @@ var StreamChat = class _StreamChat {
14874
14881
  return this.userAgent;
14875
14882
  }
14876
14883
  if (!this.cachedUserAgent) {
14877
- const version = "9.50.1";
14884
+ const version = "9.50.2";
14878
14885
  const { name: sdkName, version: sdkVersion } = this.sdkIdentifier ?? {};
14879
14886
  const { name: appName, version: appVersion } = this.appIdentifier ?? {};
14880
14887
  const { os, model: deviceModel } = this.deviceIdentifier ?? {};