stream-chat 9.43.0 → 9.43.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.
- package/dist/cjs/index.browser.js +9 -12
- package/dist/cjs/index.browser.js.map +2 -2
- package/dist/cjs/index.node.js +9 -12
- package/dist/cjs/index.node.js.map +2 -2
- package/dist/esm/index.mjs +9 -12
- package/dist/esm/index.mjs.map +2 -2
- package/dist/types/client.d.ts +4 -2
- package/dist/types/messageComposer/attachmentManager.d.ts +1 -1
- package/dist/types/types.d.ts +19 -4
- package/dist/types/utils.d.ts +4 -2
- package/package.json +1 -1
- package/src/client.ts +0 -8
- package/src/connection.ts +5 -4
- package/src/messageComposer/MessageComposerEffectHandlers.ts +2 -0
- package/src/messageComposer/attachmentManager.ts +1 -2
- package/src/types.ts +27 -4
package/dist/esm/index.mjs
CHANGED
|
@@ -3086,7 +3086,7 @@ var _AttachmentManager = class _AttachmentManager {
|
|
|
3086
3086
|
this.setCustomUploadFn = (doUploadRequest) => {
|
|
3087
3087
|
this.composer.updateConfig({ attachments: { doUploadRequest } });
|
|
3088
3088
|
};
|
|
3089
|
-
this.cancelAttachmentUploads = (attachments) => {
|
|
3089
|
+
this.cancelAttachmentUploads = (attachments = this.attachments) => {
|
|
3090
3090
|
for (const { localMetadata } of attachments) {
|
|
3091
3091
|
this.client.uploadManager.deleteUploadRecord(localMetadata.id);
|
|
3092
3092
|
}
|
|
@@ -3104,7 +3104,6 @@ var _AttachmentManager = class _AttachmentManager {
|
|
|
3104
3104
|
};
|
|
3105
3105
|
};
|
|
3106
3106
|
this.initState = ({ message } = {}) => {
|
|
3107
|
-
this.cancelAttachmentUploads(this.attachments);
|
|
3108
3107
|
this.state.next(initState({ message }));
|
|
3109
3108
|
};
|
|
3110
3109
|
this.getSnapshot = () => {
|
|
@@ -3971,7 +3970,9 @@ var applyCommandActivationEffect = (effect, composer) => {
|
|
|
3971
3970
|
selection: { start: 0, end: 0 },
|
|
3972
3971
|
text: ""
|
|
3973
3972
|
});
|
|
3973
|
+
const attachmentsToCancel = composer.attachmentManager.attachments;
|
|
3974
3974
|
composer.attachmentManager.initState();
|
|
3975
|
+
composer.attachmentManager.cancelAttachmentUploads(attachmentsToCancel);
|
|
3975
3976
|
composer.linkPreviewsManager.initState();
|
|
3976
3977
|
composer.locationComposer.initState();
|
|
3977
3978
|
composer.pollComposer.initState();
|
|
@@ -10266,8 +10267,9 @@ var StableWSConnection = class {
|
|
|
10266
10267
|
this.onmessage = (wsID, event) => {
|
|
10267
10268
|
if (this.wsID !== wsID) return;
|
|
10268
10269
|
this._log("onmessage() - onmessage callback", { event, wsID });
|
|
10269
|
-
|
|
10270
|
-
|
|
10270
|
+
if (typeof event.data !== "string") return;
|
|
10271
|
+
const data = JSON.parse(event.data);
|
|
10272
|
+
if (!this.isResolved) {
|
|
10271
10273
|
this.isResolved = true;
|
|
10272
10274
|
if (data.error) {
|
|
10273
10275
|
this.rejectPromise?.(this._errorFromWSEvent(data, false));
|
|
@@ -10277,10 +10279,10 @@ var StableWSConnection = class {
|
|
|
10277
10279
|
this._setHealth(true);
|
|
10278
10280
|
}
|
|
10279
10281
|
this.lastEvent = /* @__PURE__ */ new Date();
|
|
10280
|
-
if (data
|
|
10282
|
+
if (data.type === "health.check") {
|
|
10281
10283
|
this.scheduleNextPing();
|
|
10282
10284
|
}
|
|
10283
|
-
this.client.
|
|
10285
|
+
this.client.dispatchEvent(data);
|
|
10284
10286
|
this.scheduleConnectionCheck();
|
|
10285
10287
|
};
|
|
10286
10288
|
this.onclose = (wsID, event) => {
|
|
@@ -13383,11 +13385,6 @@ var StreamChat = class _StreamChat {
|
|
|
13383
13385
|
method: `handleEvent;${event.type}`
|
|
13384
13386
|
});
|
|
13385
13387
|
};
|
|
13386
|
-
this.handleEvent = (messageEvent) => {
|
|
13387
|
-
const jsonString = messageEvent.data;
|
|
13388
|
-
const event = JSON.parse(jsonString);
|
|
13389
|
-
this.dispatchEvent(event);
|
|
13390
|
-
};
|
|
13391
13388
|
/**
|
|
13392
13389
|
* Updates the members, watchers and read references of the currently active channels that contain this user
|
|
13393
13390
|
*
|
|
@@ -15475,7 +15472,7 @@ var StreamChat = class _StreamChat {
|
|
|
15475
15472
|
if (this.userAgent) {
|
|
15476
15473
|
return this.userAgent;
|
|
15477
15474
|
}
|
|
15478
|
-
const version = "9.43.
|
|
15475
|
+
const version = "9.43.1";
|
|
15479
15476
|
const clientBundle = "browser-esm";
|
|
15480
15477
|
let userAgentString = "";
|
|
15481
15478
|
if (this.sdkIdentifier) {
|