stream-chat 9.6.0 → 9.6.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.cjs +27 -16
- package/dist/cjs/index.browser.cjs.map +3 -3
- package/dist/cjs/index.node.cjs +30 -19
- package/dist/cjs/index.node.cjs.map +3 -3
- package/dist/esm/index.js +27 -16
- package/dist/esm/index.js.map +3 -3
- package/dist/types/utils/WithSubscriptions.d.ts +7 -2
- package/package.json +1 -1
- package/src/messageComposer/messageComposer.ts +16 -18
- package/src/utils/WithSubscriptions.ts +16 -2
|
@@ -7352,6 +7352,7 @@ var TextComposer = class {
|
|
|
7352
7352
|
var _WithSubscriptions = class _WithSubscriptions {
|
|
7353
7353
|
constructor() {
|
|
7354
7354
|
this.unsubscribeFunctions = /* @__PURE__ */ new Set();
|
|
7355
|
+
this.refCount = 0;
|
|
7355
7356
|
}
|
|
7356
7357
|
/**
|
|
7357
7358
|
* Returns a boolean, provides information of whether `registerSubscriptions`
|
|
@@ -7363,6 +7364,12 @@ var _WithSubscriptions = class _WithSubscriptions {
|
|
|
7363
7364
|
addUnsubscribeFunction(unsubscribeFunction) {
|
|
7364
7365
|
this.unsubscribeFunctions.add(unsubscribeFunction);
|
|
7365
7366
|
}
|
|
7367
|
+
/**
|
|
7368
|
+
* Increments `refCount` by one and returns new value.
|
|
7369
|
+
*/
|
|
7370
|
+
incrementRefCount() {
|
|
7371
|
+
return ++this.refCount;
|
|
7372
|
+
}
|
|
7366
7373
|
/**
|
|
7367
7374
|
* If you re-declare `unregisterSubscriptions` method within your class
|
|
7368
7375
|
* make sure to run the original too.
|
|
@@ -7379,8 +7386,13 @@ var _WithSubscriptions = class _WithSubscriptions {
|
|
|
7379
7386
|
* ```
|
|
7380
7387
|
*/
|
|
7381
7388
|
unregisterSubscriptions() {
|
|
7389
|
+
if (this.refCount > 1) {
|
|
7390
|
+
this.refCount--;
|
|
7391
|
+
return _WithSubscriptions.symbol;
|
|
7392
|
+
}
|
|
7382
7393
|
this.unsubscribeFunctions.forEach((unsubscribe) => unsubscribe());
|
|
7383
7394
|
this.unsubscribeFunctions.clear();
|
|
7395
|
+
this.refCount = 0;
|
|
7384
7396
|
return _WithSubscriptions.symbol;
|
|
7385
7397
|
}
|
|
7386
7398
|
};
|
|
@@ -7866,7 +7878,6 @@ var initState5 = (composition) => {
|
|
|
7866
7878
|
showReplyInChannel: false
|
|
7867
7879
|
};
|
|
7868
7880
|
};
|
|
7869
|
-
var noop3 = () => void 0;
|
|
7870
7881
|
var _MessageComposer = class _MessageComposer extends WithSubscriptions {
|
|
7871
7882
|
// todo: mediaRecorder: MediaRecorderController;
|
|
7872
7883
|
constructor({
|
|
@@ -7893,20 +7904,20 @@ var _MessageComposer = class _MessageComposer extends WithSubscriptions {
|
|
|
7893
7904
|
};
|
|
7894
7905
|
this.initEditingAuditState = (composition) => initEditingAuditState(composition);
|
|
7895
7906
|
this.registerSubscriptions = () => {
|
|
7896
|
-
if (this.hasSubscriptions) {
|
|
7897
|
-
|
|
7898
|
-
|
|
7899
|
-
|
|
7900
|
-
|
|
7901
|
-
|
|
7902
|
-
|
|
7903
|
-
|
|
7904
|
-
|
|
7905
|
-
|
|
7906
|
-
|
|
7907
|
-
|
|
7908
|
-
this.
|
|
7909
|
-
return this.unregisterSubscriptions
|
|
7907
|
+
if (!this.hasSubscriptions) {
|
|
7908
|
+
this.addUnsubscribeFunction(this.subscribeMessageComposerSetupStateChange());
|
|
7909
|
+
this.addUnsubscribeFunction(this.subscribeMessageUpdated());
|
|
7910
|
+
this.addUnsubscribeFunction(this.subscribeMessageDeleted());
|
|
7911
|
+
this.addUnsubscribeFunction(this.subscribeTextComposerStateChanged());
|
|
7912
|
+
this.addUnsubscribeFunction(this.subscribeAttachmentManagerStateChanged());
|
|
7913
|
+
this.addUnsubscribeFunction(this.subscribeLinkPreviewsManagerStateChanged());
|
|
7914
|
+
this.addUnsubscribeFunction(this.subscribePollComposerStateChanged());
|
|
7915
|
+
this.addUnsubscribeFunction(this.subscribeCustomDataManagerStateChanged());
|
|
7916
|
+
this.addUnsubscribeFunction(this.subscribeMessageComposerStateChanged());
|
|
7917
|
+
this.addUnsubscribeFunction(this.subscribeMessageComposerConfigStateChanged());
|
|
7918
|
+
}
|
|
7919
|
+
this.incrementRefCount();
|
|
7920
|
+
return () => this.unregisterSubscriptions();
|
|
7910
7921
|
};
|
|
7911
7922
|
this.subscribeMessageUpdated = () => {
|
|
7912
7923
|
const eventTypes = [
|
|
@@ -15148,7 +15159,7 @@ var StreamChat = class _StreamChat {
|
|
|
15148
15159
|
if (this.userAgent) {
|
|
15149
15160
|
return this.userAgent;
|
|
15150
15161
|
}
|
|
15151
|
-
const version = "9.6.
|
|
15162
|
+
const version = "9.6.1";
|
|
15152
15163
|
const clientBundle = "browser-cjs";
|
|
15153
15164
|
let userAgentString = "";
|
|
15154
15165
|
if (this.sdkIdentifier) {
|