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.
@@ -3637,7 +3637,8 @@ var _AttachmentManager = class _AttachmentManager {
3637
3637
  return attachment;
3638
3638
  };
3639
3639
  this.uploadFiles = async (files) => {
3640
- if (!this.isUploadEnabled) return;
3640
+ if (this.hasCustomDoUploadRequest && !this.hasAvailableUploadSlots || !this.hasCustomDoUploadRequest && !this.isUploadEnabled)
3641
+ return;
3641
3642
  const iterableFiles = isFileList(files) ? Array.from(files) : files;
3642
3643
  return await Promise.all(
3643
3644
  iterableFiles.slice(0, this.availableUploadSlots).map(this.uploadFile)
@@ -3706,8 +3707,14 @@ var _AttachmentManager = class _AttachmentManager {
3706
3707
  get hasUploadPermission() {
3707
3708
  return !!this.channel.data?.own_capabilities?.includes("upload-file");
3708
3709
  }
3710
+ get hasCustomDoUploadRequest() {
3711
+ return typeof this.config.doUploadRequest === "function";
3712
+ }
3713
+ get hasAvailableUploadSlots() {
3714
+ return this.availableUploadSlots > 0;
3715
+ }
3709
3716
  get isUploadEnabled() {
3710
- return this.hasUploadPermission && this.availableUploadSlots > 0;
3717
+ return this.hasUploadPermission && this.hasAvailableUploadSlots;
3711
3718
  }
3712
3719
  get successfulUploads() {
3713
3720
  return this.getUploadsByState("finished");
@@ -14843,7 +14850,7 @@ var StreamChat = class _StreamChat {
14843
14850
  return this.userAgent;
14844
14851
  }
14845
14852
  if (!this.cachedUserAgent) {
14846
- const version = "9.50.1";
14853
+ const version = "9.50.2";
14847
14854
  const { name: sdkName, version: sdkVersion } = this.sdkIdentifier ?? {};
14848
14855
  const { name: appName, version: appVersion } = this.appIdentifier ?? {};
14849
14856
  const { os, model: deviceModel } = this.deviceIdentifier ?? {};