stream-chat-react 10.7.3 → 10.7.5
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/browser.full-bundle.js +97 -58
- package/dist/browser.full-bundle.js.map +1 -1
- package/dist/browser.full-bundle.min.js +1 -1
- package/dist/browser.full-bundle.min.js.map +1 -1
- package/dist/components/Channel/Channel.d.ts.map +1 -1
- package/dist/components/Channel/Channel.js +95 -57
- package/dist/components/MessageInput/hooks/useCreateMessageInputContext.d.ts.map +1 -1
- package/dist/components/MessageInput/hooks/useCreateMessageInputContext.js +1 -0
- package/dist/index.cjs.js +97 -58
- package/dist/index.cjs.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Channel.d.ts","sourceRoot":"","sources":["../../../src/components/Channel/Channel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EACZ,iBAAiB,EAOlB,MAAM,OAAO,CAAC;AAIf,OAAO,EAKL,OAAO,EACP,eAAe,EAEf,OAAO,IAAI,aAAa,EACxB,UAAU,EACV,cAAc,EAEf,MAAM,aAAa,CAAC;AAUrB,OAAO,EAAE,eAAe,EAAuB,MAAM,6BAA6B,CAAC;AAGnF,OAAO,EAEL,0BAA0B,EAC3B,MAAM,YAAY,CAAC;AAepB,OAAO,EAAE,qBAAqB,EAAqB,MAAM,gCAAgC,CAAC;AAE1F,OAAO,EAAe,iBAAiB,EAAiB,MAAM,4BAA4B,CAAC;AAc3F,OAAO,KAAK,EAAE,IAAI,IAAI,aAAa,EAAE,MAAM,YAAY,CAAC;AAExD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAEtE,OAAO,KAAK,EACV,aAAa,EACb,yBAAyB,EACzB,aAAa,EACb,0BAA0B,EAC1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C;IACvC,mJAAmJ;IACnJ,0BAA0B,CAAC,EAAE,OAAO,CAAC;IACrC,qQAAqQ;IACrQ,UAAU,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,YAAY,CAAC,kBAAkB,CAAC,CAAC,CAAC;IACnE,yNAAyN;IACzN,YAAY,CAAC,EAAE,qBAAqB,CAAC,kBAAkB,CAAC,CAAC,cAAc,CAAC,CAAC;IACzE,qOAAqO;IACrO,WAAW,CAAC,EAAE,qBAAqB,CAAC,kBAAkB,CAAC,CAAC,aAAa,CAAC,CAAC;IACvE,mPAAmP;IACnP,eAAe,CAAC,EAAE,qBAAqB,CAAC,kBAAkB,CAAC,CAAC,iBAAiB,CAAC,CAAC;IAC/E,4NAA4N;IAC5N,eAAe,CAAC,EAAE,qBAAqB,CAAC,kBAAkB,CAAC,CAAC,iBAAiB,CAAC,CAAC;IAC/E,4EAA4E;IAC5E,0BAA0B,CAAC,EAAE,0BAA0B,CAAC;IACxD,uHAAuH;IACvH,cAAc,CAAC,EAAE,qBAAqB,CAAC,kBAAkB,CAAC,CAAC,gBAAgB,CAAC,CAAC;CAC9E,CAAC;AAuwBF;;;;;;;;GAQG;AACH,eAAO,MAAM,OAAO,iNAA4D,CAAC"}
|
|
@@ -154,55 +154,78 @@ var ChannelInner = function (props) {
|
|
|
154
154
|
}
|
|
155
155
|
};
|
|
156
156
|
var markReadThrottled = throttle(markRead, 500, { leading: true, trailing: true });
|
|
157
|
-
var handleEvent = function (event) {
|
|
158
|
-
var
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
return dispatch({ channel: channel, type: 'setTyping' });
|
|
170
|
-
}
|
|
171
|
-
if (event.type === 'connection.changed' && typeof event.online === 'boolean') {
|
|
172
|
-
online.current = event.online;
|
|
173
|
-
}
|
|
174
|
-
if (event.type === 'message.new') {
|
|
175
|
-
var mainChannelUpdated = true;
|
|
176
|
-
if (((_a = event.message) === null || _a === void 0 ? void 0 : _a.parent_id) && !((_b = event.message) === null || _b === void 0 ? void 0 : _b.show_in_channel)) {
|
|
177
|
-
mainChannelUpdated = false;
|
|
178
|
-
}
|
|
179
|
-
if (mainChannelUpdated && ((_d = (_c = event.message) === null || _c === void 0 ? void 0 : _c.user) === null || _d === void 0 ? void 0 : _d.id) !== client.userID) {
|
|
180
|
-
if (!document.hidden) {
|
|
181
|
-
markReadThrottled();
|
|
182
|
-
}
|
|
183
|
-
else if ((channelConfig === null || channelConfig === void 0 ? void 0 : channelConfig.read_events) && !channel.muteStatus().muted) {
|
|
184
|
-
var unread = channel.countUnread(lastRead.current);
|
|
185
|
-
if (activeUnreadHandler) {
|
|
186
|
-
activeUnreadHandler(unread, originalTitle.current);
|
|
157
|
+
var handleEvent = function (event) { return __awaiter(void 0, void 0, void 0, function () {
|
|
158
|
+
var mainChannelUpdated, unread, messageDate, cid, oldestID;
|
|
159
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
160
|
+
return __generator(this, function (_m) {
|
|
161
|
+
switch (_m.label) {
|
|
162
|
+
case 0:
|
|
163
|
+
if (event.message) {
|
|
164
|
+
dispatch({
|
|
165
|
+
channel: channel,
|
|
166
|
+
message: event.message,
|
|
167
|
+
type: 'updateThreadOnEvent',
|
|
168
|
+
});
|
|
187
169
|
}
|
|
188
|
-
|
|
189
|
-
|
|
170
|
+
if (event.type === 'user.watching.start' || event.type === 'user.watching.stop')
|
|
171
|
+
return [2 /*return*/];
|
|
172
|
+
if (event.type === 'typing.start' || event.type === 'typing.stop') {
|
|
173
|
+
return [2 /*return*/, dispatch({ channel: channel, type: 'setTyping' })];
|
|
190
174
|
}
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
175
|
+
if (event.type === 'connection.changed' && typeof event.online === 'boolean') {
|
|
176
|
+
online.current = event.online;
|
|
177
|
+
}
|
|
178
|
+
if (event.type === 'message.new') {
|
|
179
|
+
mainChannelUpdated = true;
|
|
180
|
+
if (((_a = event.message) === null || _a === void 0 ? void 0 : _a.parent_id) && !((_b = event.message) === null || _b === void 0 ? void 0 : _b.show_in_channel)) {
|
|
181
|
+
mainChannelUpdated = false;
|
|
182
|
+
}
|
|
183
|
+
if (mainChannelUpdated && ((_d = (_c = event.message) === null || _c === void 0 ? void 0 : _c.user) === null || _d === void 0 ? void 0 : _d.id) !== client.userID) {
|
|
184
|
+
if (!document.hidden) {
|
|
185
|
+
markReadThrottled();
|
|
186
|
+
}
|
|
187
|
+
else if ((channelConfig === null || channelConfig === void 0 ? void 0 : channelConfig.read_events) && !channel.muteStatus().muted) {
|
|
188
|
+
unread = channel.countUnread(lastRead.current);
|
|
189
|
+
if (activeUnreadHandler) {
|
|
190
|
+
activeUnreadHandler(unread, originalTitle.current);
|
|
191
|
+
}
|
|
192
|
+
else {
|
|
193
|
+
document.title = "(".concat(unread, ") ").concat(originalTitle.current);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
if (((_f = (_e = event.message) === null || _e === void 0 ? void 0 : _e.user) === null || _f === void 0 ? void 0 : _f.id) === client.userID &&
|
|
198
|
+
((_g = event === null || event === void 0 ? void 0 : event.message) === null || _g === void 0 ? void 0 : _g.created_at) &&
|
|
199
|
+
((_h = event === null || event === void 0 ? void 0 : event.message) === null || _h === void 0 ? void 0 : _h.cid)) {
|
|
200
|
+
messageDate = new Date(event.message.created_at);
|
|
201
|
+
cid = event.message.cid;
|
|
202
|
+
if (!latestMessageDatesByChannels[cid] ||
|
|
203
|
+
latestMessageDatesByChannels[cid].getTime() < messageDate.getTime()) {
|
|
204
|
+
latestMessageDatesByChannels[cid] = messageDate;
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
if (!(event.type === 'user.deleted')) return [3 /*break*/, 2];
|
|
209
|
+
oldestID = (_l = (_k = (_j = channel.state) === null || _j === void 0 ? void 0 : _j.messages) === null || _k === void 0 ? void 0 : _k[0]) === null || _l === void 0 ? void 0 : _l.id;
|
|
210
|
+
/**
|
|
211
|
+
* As the channel state is not normalized we re-fetch the channel data. Thus, we avoid having to search for user references in the channel state.
|
|
212
|
+
*/
|
|
213
|
+
return [4 /*yield*/, channel.query({
|
|
214
|
+
messages: { id_lt: oldestID, limit: DEFAULT_NEXT_CHANNEL_PAGE_SIZE },
|
|
215
|
+
watchers: { limit: DEFAULT_NEXT_CHANNEL_PAGE_SIZE },
|
|
216
|
+
})];
|
|
217
|
+
case 1:
|
|
218
|
+
/**
|
|
219
|
+
* As the channel state is not normalized we re-fetch the channel data. Thus, we avoid having to search for user references in the channel state.
|
|
220
|
+
*/
|
|
221
|
+
_m.sent();
|
|
222
|
+
_m.label = 2;
|
|
223
|
+
case 2:
|
|
224
|
+
throttledCopyStateFromChannel();
|
|
225
|
+
return [2 /*return*/];
|
|
202
226
|
}
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
};
|
|
227
|
+
});
|
|
228
|
+
}); };
|
|
206
229
|
// useLayoutEffect here to prevent spinner. Use Suspense when it is available in stable release
|
|
207
230
|
useLayoutEffect(function () {
|
|
208
231
|
var errored = false;
|
|
@@ -424,9 +447,10 @@ var ChannelInner = function (props) {
|
|
|
424
447
|
};
|
|
425
448
|
var isUserResponseArray = function (output) { var _a; return ((_a = output[0]) === null || _a === void 0 ? void 0 : _a.id) != null; };
|
|
426
449
|
var doSendMessage = function (message, customMessageData) { return __awaiter(void 0, void 0, void 0, function () {
|
|
427
|
-
var attachments, id, _a, mentioned_users, parent_id, text, mentions, messageData, messageResponse, error_1, stringError, parsedError;
|
|
428
|
-
|
|
429
|
-
|
|
450
|
+
var attachments, id, _a, mentioned_users, parent_id, text, mentions, messageData, messageResponse, existingMessage, i, msg, responseTimestamp, existingMessageTimestamp, responseIsTheNewest, error_1, stringError, parsedError;
|
|
451
|
+
var _b, _c;
|
|
452
|
+
return __generator(this, function (_d) {
|
|
453
|
+
switch (_d.label) {
|
|
430
454
|
case 0:
|
|
431
455
|
attachments = message.attachments, id = message.id, _a = message.mentioned_users, mentioned_users = _a === void 0 ? [] : _a, parent_id = message.parent_id, text = message.text;
|
|
432
456
|
mentions = isUserResponseArray(mentioned_users)
|
|
@@ -436,29 +460,43 @@ var ChannelInner = function (props) {
|
|
|
436
460
|
})
|
|
437
461
|
: mentioned_users;
|
|
438
462
|
messageData = __assign({ attachments: attachments, id: id, mentioned_users: mentions, parent_id: parent_id, quoted_message_id: parent_id === (quotedMessage === null || quotedMessage === void 0 ? void 0 : quotedMessage.parent_id) ? quotedMessage === null || quotedMessage === void 0 ? void 0 : quotedMessage.id : undefined, text: text }, customMessageData);
|
|
439
|
-
|
|
463
|
+
_d.label = 1;
|
|
440
464
|
case 1:
|
|
441
|
-
|
|
465
|
+
_d.trys.push([1, 6, , 7]);
|
|
442
466
|
messageResponse = void 0;
|
|
443
467
|
if (!doSendMessageRequest) return [3 /*break*/, 3];
|
|
444
468
|
return [4 /*yield*/, doSendMessageRequest(channel.cid, messageData)];
|
|
445
469
|
case 2:
|
|
446
|
-
messageResponse =
|
|
470
|
+
messageResponse = _d.sent();
|
|
447
471
|
return [3 /*break*/, 5];
|
|
448
472
|
case 3: return [4 /*yield*/, channel.sendMessage(messageData)];
|
|
449
473
|
case 4:
|
|
450
|
-
messageResponse =
|
|
451
|
-
|
|
474
|
+
messageResponse = _d.sent();
|
|
475
|
+
_d.label = 5;
|
|
452
476
|
case 5:
|
|
453
|
-
|
|
454
|
-
|
|
477
|
+
existingMessage = void 0;
|
|
478
|
+
for (i = channel.state.messages.length - 1; i >= 0; i--) {
|
|
479
|
+
msg = channel.state.messages[i];
|
|
480
|
+
if (msg.id === messageData.id) {
|
|
481
|
+
existingMessage = msg;
|
|
482
|
+
break;
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
responseTimestamp = new Date(((_b = messageResponse === null || messageResponse === void 0 ? void 0 : messageResponse.message) === null || _b === void 0 ? void 0 : _b.updated_at) || 0).getTime();
|
|
486
|
+
existingMessageTimestamp = ((_c = existingMessage === null || existingMessage === void 0 ? void 0 : existingMessage.updated_at) === null || _c === void 0 ? void 0 : _c.getTime()) || 0;
|
|
487
|
+
responseIsTheNewest = responseTimestamp > existingMessageTimestamp;
|
|
488
|
+
// Replace the message payload after send is completed
|
|
489
|
+
// We need to check for the newest message payload, because on slow network, the response can arrive later than WS events message.new, message.updated.
|
|
490
|
+
// Always override existing message in status "sending"
|
|
491
|
+
if ((messageResponse === null || messageResponse === void 0 ? void 0 : messageResponse.message) &&
|
|
492
|
+
(responseIsTheNewest || (existingMessage === null || existingMessage === void 0 ? void 0 : existingMessage.status) === 'sending')) {
|
|
455
493
|
updateMessage(__assign(__assign({}, messageResponse.message), { status: 'received' }));
|
|
456
494
|
}
|
|
457
495
|
if (quotedMessage && parent_id === (quotedMessage === null || quotedMessage === void 0 ? void 0 : quotedMessage.parent_id))
|
|
458
496
|
setQuotedMessage(undefined);
|
|
459
497
|
return [3 /*break*/, 7];
|
|
460
498
|
case 6:
|
|
461
|
-
error_1 =
|
|
499
|
+
error_1 = _d.sent();
|
|
462
500
|
stringError = JSON.stringify(error_1);
|
|
463
501
|
parsedError = stringError ? JSON.parse(stringError) : {};
|
|
464
502
|
updateMessage(__assign(__assign({}, message), { error: parsedError, errorStatusCode: parsedError.status || undefined, status: 'failed' }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCreateMessageInputContext.d.ts","sourceRoot":"","sources":["../../../../src/components/MessageInput/hooks/useCreateMessageInputContext.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,sCAAsC,CAAC;AACrF,OAAO,KAAK,EAAE,aAAa,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AAErF,eAAO,MAAM,4BAA4B,
|
|
1
|
+
{"version":3,"file":"useCreateMessageInputContext.d.ts","sourceRoot":"","sources":["../../../../src/components/MessageInput/hooks/useCreateMessageInputContext.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,sCAAsC,CAAC;AACrF,OAAO,KAAK,EAAE,aAAa,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AAErF,eAAO,MAAM,4BAA4B,wOA+JxC,CAAC"}
|
package/dist/index.cjs.js
CHANGED
|
@@ -31128,6 +31128,7 @@ var useCreateMessageInputContext = function (value) {
|
|
|
31128
31128
|
showCommandsList,
|
|
31129
31129
|
showMentionsList,
|
|
31130
31130
|
text,
|
|
31131
|
+
handleSubmit,
|
|
31131
31132
|
]);
|
|
31132
31133
|
return messageInputContext;
|
|
31133
31134
|
};
|
|
@@ -31984,55 +31985,78 @@ var ChannelInner = function (props) {
|
|
|
31984
31985
|
}
|
|
31985
31986
|
};
|
|
31986
31987
|
var markReadThrottled = throttle__default["default"](markRead, 500, { leading: true, trailing: true });
|
|
31987
|
-
var handleEvent = function (event) {
|
|
31988
|
-
var
|
|
31989
|
-
|
|
31990
|
-
|
|
31991
|
-
|
|
31992
|
-
|
|
31993
|
-
|
|
31994
|
-
|
|
31995
|
-
|
|
31996
|
-
|
|
31997
|
-
|
|
31998
|
-
|
|
31999
|
-
return dispatch({ channel: channel, type: 'setTyping' });
|
|
32000
|
-
}
|
|
32001
|
-
if (event.type === 'connection.changed' && typeof event.online === 'boolean') {
|
|
32002
|
-
online.current = event.online;
|
|
32003
|
-
}
|
|
32004
|
-
if (event.type === 'message.new') {
|
|
32005
|
-
var mainChannelUpdated = true;
|
|
32006
|
-
if (((_a = event.message) === null || _a === void 0 ? void 0 : _a.parent_id) && !((_b = event.message) === null || _b === void 0 ? void 0 : _b.show_in_channel)) {
|
|
32007
|
-
mainChannelUpdated = false;
|
|
32008
|
-
}
|
|
32009
|
-
if (mainChannelUpdated && ((_d = (_c = event.message) === null || _c === void 0 ? void 0 : _c.user) === null || _d === void 0 ? void 0 : _d.id) !== client.userID) {
|
|
32010
|
-
if (!document.hidden) {
|
|
32011
|
-
markReadThrottled();
|
|
32012
|
-
}
|
|
32013
|
-
else if ((channelConfig === null || channelConfig === void 0 ? void 0 : channelConfig.read_events) && !channel.muteStatus().muted) {
|
|
32014
|
-
var unread = channel.countUnread(lastRead.current);
|
|
32015
|
-
if (activeUnreadHandler) {
|
|
32016
|
-
activeUnreadHandler(unread, originalTitle.current);
|
|
31988
|
+
var handleEvent = function (event) { return __awaiter(void 0, void 0, void 0, function () {
|
|
31989
|
+
var mainChannelUpdated, unread, messageDate, cid, oldestID;
|
|
31990
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
31991
|
+
return __generator(this, function (_m) {
|
|
31992
|
+
switch (_m.label) {
|
|
31993
|
+
case 0:
|
|
31994
|
+
if (event.message) {
|
|
31995
|
+
dispatch({
|
|
31996
|
+
channel: channel,
|
|
31997
|
+
message: event.message,
|
|
31998
|
+
type: 'updateThreadOnEvent',
|
|
31999
|
+
});
|
|
32017
32000
|
}
|
|
32018
|
-
|
|
32019
|
-
|
|
32001
|
+
if (event.type === 'user.watching.start' || event.type === 'user.watching.stop')
|
|
32002
|
+
return [2 /*return*/];
|
|
32003
|
+
if (event.type === 'typing.start' || event.type === 'typing.stop') {
|
|
32004
|
+
return [2 /*return*/, dispatch({ channel: channel, type: 'setTyping' })];
|
|
32020
32005
|
}
|
|
32021
|
-
|
|
32022
|
-
|
|
32023
|
-
|
|
32024
|
-
|
|
32025
|
-
|
|
32026
|
-
|
|
32027
|
-
|
|
32028
|
-
|
|
32029
|
-
|
|
32030
|
-
|
|
32031
|
-
|
|
32006
|
+
if (event.type === 'connection.changed' && typeof event.online === 'boolean') {
|
|
32007
|
+
online.current = event.online;
|
|
32008
|
+
}
|
|
32009
|
+
if (event.type === 'message.new') {
|
|
32010
|
+
mainChannelUpdated = true;
|
|
32011
|
+
if (((_a = event.message) === null || _a === void 0 ? void 0 : _a.parent_id) && !((_b = event.message) === null || _b === void 0 ? void 0 : _b.show_in_channel)) {
|
|
32012
|
+
mainChannelUpdated = false;
|
|
32013
|
+
}
|
|
32014
|
+
if (mainChannelUpdated && ((_d = (_c = event.message) === null || _c === void 0 ? void 0 : _c.user) === null || _d === void 0 ? void 0 : _d.id) !== client.userID) {
|
|
32015
|
+
if (!document.hidden) {
|
|
32016
|
+
markReadThrottled();
|
|
32017
|
+
}
|
|
32018
|
+
else if ((channelConfig === null || channelConfig === void 0 ? void 0 : channelConfig.read_events) && !channel.muteStatus().muted) {
|
|
32019
|
+
unread = channel.countUnread(lastRead.current);
|
|
32020
|
+
if (activeUnreadHandler) {
|
|
32021
|
+
activeUnreadHandler(unread, originalTitle.current);
|
|
32022
|
+
}
|
|
32023
|
+
else {
|
|
32024
|
+
document.title = "(".concat(unread, ") ").concat(originalTitle.current);
|
|
32025
|
+
}
|
|
32026
|
+
}
|
|
32027
|
+
}
|
|
32028
|
+
if (((_f = (_e = event.message) === null || _e === void 0 ? void 0 : _e.user) === null || _f === void 0 ? void 0 : _f.id) === client.userID &&
|
|
32029
|
+
((_g = event === null || event === void 0 ? void 0 : event.message) === null || _g === void 0 ? void 0 : _g.created_at) &&
|
|
32030
|
+
((_h = event === null || event === void 0 ? void 0 : event.message) === null || _h === void 0 ? void 0 : _h.cid)) {
|
|
32031
|
+
messageDate = new Date(event.message.created_at);
|
|
32032
|
+
cid = event.message.cid;
|
|
32033
|
+
if (!latestMessageDatesByChannels[cid] ||
|
|
32034
|
+
latestMessageDatesByChannels[cid].getTime() < messageDate.getTime()) {
|
|
32035
|
+
latestMessageDatesByChannels[cid] = messageDate;
|
|
32036
|
+
}
|
|
32037
|
+
}
|
|
32038
|
+
}
|
|
32039
|
+
if (!(event.type === 'user.deleted')) return [3 /*break*/, 2];
|
|
32040
|
+
oldestID = (_l = (_k = (_j = channel.state) === null || _j === void 0 ? void 0 : _j.messages) === null || _k === void 0 ? void 0 : _k[0]) === null || _l === void 0 ? void 0 : _l.id;
|
|
32041
|
+
/**
|
|
32042
|
+
* As the channel state is not normalized we re-fetch the channel data. Thus, we avoid having to search for user references in the channel state.
|
|
32043
|
+
*/
|
|
32044
|
+
return [4 /*yield*/, channel.query({
|
|
32045
|
+
messages: { id_lt: oldestID, limit: DEFAULT_NEXT_CHANNEL_PAGE_SIZE },
|
|
32046
|
+
watchers: { limit: DEFAULT_NEXT_CHANNEL_PAGE_SIZE },
|
|
32047
|
+
})];
|
|
32048
|
+
case 1:
|
|
32049
|
+
/**
|
|
32050
|
+
* As the channel state is not normalized we re-fetch the channel data. Thus, we avoid having to search for user references in the channel state.
|
|
32051
|
+
*/
|
|
32052
|
+
_m.sent();
|
|
32053
|
+
_m.label = 2;
|
|
32054
|
+
case 2:
|
|
32055
|
+
throttledCopyStateFromChannel();
|
|
32056
|
+
return [2 /*return*/];
|
|
32032
32057
|
}
|
|
32033
|
-
}
|
|
32034
|
-
|
|
32035
|
-
};
|
|
32058
|
+
});
|
|
32059
|
+
}); };
|
|
32036
32060
|
// useLayoutEffect here to prevent spinner. Use Suspense when it is available in stable release
|
|
32037
32061
|
React.useLayoutEffect(function () {
|
|
32038
32062
|
var errored = false;
|
|
@@ -32254,9 +32278,10 @@ var ChannelInner = function (props) {
|
|
|
32254
32278
|
};
|
|
32255
32279
|
var isUserResponseArray = function (output) { var _a; return ((_a = output[0]) === null || _a === void 0 ? void 0 : _a.id) != null; };
|
|
32256
32280
|
var doSendMessage = function (message, customMessageData) { return __awaiter(void 0, void 0, void 0, function () {
|
|
32257
|
-
var attachments, id, _a, mentioned_users, parent_id, text, mentions, messageData, messageResponse, error_1, stringError, parsedError;
|
|
32258
|
-
|
|
32259
|
-
|
|
32281
|
+
var attachments, id, _a, mentioned_users, parent_id, text, mentions, messageData, messageResponse, existingMessage, i, msg, responseTimestamp, existingMessageTimestamp, responseIsTheNewest, error_1, stringError, parsedError;
|
|
32282
|
+
var _b, _c;
|
|
32283
|
+
return __generator(this, function (_d) {
|
|
32284
|
+
switch (_d.label) {
|
|
32260
32285
|
case 0:
|
|
32261
32286
|
attachments = message.attachments, id = message.id, _a = message.mentioned_users, mentioned_users = _a === void 0 ? [] : _a, parent_id = message.parent_id, text = message.text;
|
|
32262
32287
|
mentions = isUserResponseArray(mentioned_users)
|
|
@@ -32266,29 +32291,43 @@ var ChannelInner = function (props) {
|
|
|
32266
32291
|
})
|
|
32267
32292
|
: mentioned_users;
|
|
32268
32293
|
messageData = __assign({ attachments: attachments, id: id, mentioned_users: mentions, parent_id: parent_id, quoted_message_id: parent_id === (quotedMessage === null || quotedMessage === void 0 ? void 0 : quotedMessage.parent_id) ? quotedMessage === null || quotedMessage === void 0 ? void 0 : quotedMessage.id : undefined, text: text }, customMessageData);
|
|
32269
|
-
|
|
32294
|
+
_d.label = 1;
|
|
32270
32295
|
case 1:
|
|
32271
|
-
|
|
32296
|
+
_d.trys.push([1, 6, , 7]);
|
|
32272
32297
|
messageResponse = void 0;
|
|
32273
32298
|
if (!doSendMessageRequest) return [3 /*break*/, 3];
|
|
32274
32299
|
return [4 /*yield*/, doSendMessageRequest(channel.cid, messageData)];
|
|
32275
32300
|
case 2:
|
|
32276
|
-
messageResponse =
|
|
32301
|
+
messageResponse = _d.sent();
|
|
32277
32302
|
return [3 /*break*/, 5];
|
|
32278
32303
|
case 3: return [4 /*yield*/, channel.sendMessage(messageData)];
|
|
32279
32304
|
case 4:
|
|
32280
|
-
messageResponse =
|
|
32281
|
-
|
|
32305
|
+
messageResponse = _d.sent();
|
|
32306
|
+
_d.label = 5;
|
|
32282
32307
|
case 5:
|
|
32283
|
-
|
|
32284
|
-
|
|
32308
|
+
existingMessage = void 0;
|
|
32309
|
+
for (i = channel.state.messages.length - 1; i >= 0; i--) {
|
|
32310
|
+
msg = channel.state.messages[i];
|
|
32311
|
+
if (msg.id === messageData.id) {
|
|
32312
|
+
existingMessage = msg;
|
|
32313
|
+
break;
|
|
32314
|
+
}
|
|
32315
|
+
}
|
|
32316
|
+
responseTimestamp = new Date(((_b = messageResponse === null || messageResponse === void 0 ? void 0 : messageResponse.message) === null || _b === void 0 ? void 0 : _b.updated_at) || 0).getTime();
|
|
32317
|
+
existingMessageTimestamp = ((_c = existingMessage === null || existingMessage === void 0 ? void 0 : existingMessage.updated_at) === null || _c === void 0 ? void 0 : _c.getTime()) || 0;
|
|
32318
|
+
responseIsTheNewest = responseTimestamp > existingMessageTimestamp;
|
|
32319
|
+
// Replace the message payload after send is completed
|
|
32320
|
+
// We need to check for the newest message payload, because on slow network, the response can arrive later than WS events message.new, message.updated.
|
|
32321
|
+
// Always override existing message in status "sending"
|
|
32322
|
+
if ((messageResponse === null || messageResponse === void 0 ? void 0 : messageResponse.message) &&
|
|
32323
|
+
(responseIsTheNewest || (existingMessage === null || existingMessage === void 0 ? void 0 : existingMessage.status) === 'sending')) {
|
|
32285
32324
|
updateMessage(__assign(__assign({}, messageResponse.message), { status: 'received' }));
|
|
32286
32325
|
}
|
|
32287
32326
|
if (quotedMessage && parent_id === (quotedMessage === null || quotedMessage === void 0 ? void 0 : quotedMessage.parent_id))
|
|
32288
32327
|
setQuotedMessage(undefined);
|
|
32289
32328
|
return [3 /*break*/, 7];
|
|
32290
32329
|
case 6:
|
|
32291
|
-
error_1 =
|
|
32330
|
+
error_1 = _d.sent();
|
|
32292
32331
|
stringError = JSON.stringify(error_1);
|
|
32293
32332
|
parsedError = stringError ? JSON.parse(stringError) : {};
|
|
32294
32333
|
updateMessage(__assign(__assign({}, message), { error: parsedError, errorStatusCode: parsedError.status || undefined, status: 'failed' }));
|
|
@@ -33670,7 +33709,7 @@ var UnMemoizedChannelList = function (props) {
|
|
|
33670
33709
|
*/
|
|
33671
33710
|
var ChannelList = React__default["default"].memo(UnMemoizedChannelList);
|
|
33672
33711
|
|
|
33673
|
-
var version = '10.7.
|
|
33712
|
+
var version = '10.7.5';
|
|
33674
33713
|
|
|
33675
33714
|
var useChat = function (_a) {
|
|
33676
33715
|
var _b, _c;
|