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.
- package/dist/cjs/index.browser.js +10 -3
- package/dist/cjs/index.browser.js.map +2 -2
- package/dist/cjs/index.node.js +10 -3
- package/dist/cjs/index.node.js.map +2 -2
- package/dist/esm/index.mjs +10 -3
- package/dist/esm/index.mjs.map +2 -2
- package/dist/types/messageComposer/attachmentManager.d.ts +2 -0
- package/package.json +1 -1
- package/src/messageComposer/attachmentManager.ts +15 -2
package/dist/esm/index.mjs
CHANGED
|
@@ -3453,7 +3453,8 @@ var _AttachmentManager = class _AttachmentManager {
|
|
|
3453
3453
|
return attachment;
|
|
3454
3454
|
};
|
|
3455
3455
|
this.uploadFiles = async (files) => {
|
|
3456
|
-
if (!this.isUploadEnabled)
|
|
3456
|
+
if (this.hasCustomDoUploadRequest && !this.hasAvailableUploadSlots || !this.hasCustomDoUploadRequest && !this.isUploadEnabled)
|
|
3457
|
+
return;
|
|
3457
3458
|
const iterableFiles = isFileList(files) ? Array.from(files) : files;
|
|
3458
3459
|
return await Promise.all(
|
|
3459
3460
|
iterableFiles.slice(0, this.availableUploadSlots).map(this.uploadFile)
|
|
@@ -3522,8 +3523,14 @@ var _AttachmentManager = class _AttachmentManager {
|
|
|
3522
3523
|
get hasUploadPermission() {
|
|
3523
3524
|
return !!this.channel.data?.own_capabilities?.includes("upload-file");
|
|
3524
3525
|
}
|
|
3526
|
+
get hasCustomDoUploadRequest() {
|
|
3527
|
+
return typeof this.config.doUploadRequest === "function";
|
|
3528
|
+
}
|
|
3529
|
+
get hasAvailableUploadSlots() {
|
|
3530
|
+
return this.availableUploadSlots > 0;
|
|
3531
|
+
}
|
|
3525
3532
|
get isUploadEnabled() {
|
|
3526
|
-
return this.hasUploadPermission && this.
|
|
3533
|
+
return this.hasUploadPermission && this.hasAvailableUploadSlots;
|
|
3527
3534
|
}
|
|
3528
3535
|
get successfulUploads() {
|
|
3529
3536
|
return this.getUploadsByState("finished");
|
|
@@ -14659,7 +14666,7 @@ var StreamChat = class _StreamChat {
|
|
|
14659
14666
|
return this.userAgent;
|
|
14660
14667
|
}
|
|
14661
14668
|
if (!this.cachedUserAgent) {
|
|
14662
|
-
const version = "9.50.
|
|
14669
|
+
const version = "9.50.2";
|
|
14663
14670
|
const { name: sdkName, version: sdkVersion } = this.sdkIdentifier ?? {};
|
|
14664
14671
|
const { name: appName, version: appVersion } = this.appIdentifier ?? {};
|
|
14665
14672
|
const { os, model: deviceModel } = this.deviceIdentifier ?? {};
|