stream-chat-angular 4.58.1 → 4.58.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/assets/version.d.ts +1 -1
- package/bundles/stream-chat-angular.umd.js +20 -17
- package/bundles/stream-chat-angular.umd.js.map +1 -1
- package/esm2015/assets/version.js +2 -2
- package/esm2015/lib/channel.service.js +16 -8
- package/fesm2015/stream-chat-angular.js +16 -8
- package/fesm2015/stream-chat-angular.js.map +1 -1
- package/lib/channel.service.d.ts +1 -1
- package/package.json +1 -1
- package/src/assets/version.ts +1 -1
|
@@ -20,7 +20,7 @@ import transliterate from '@stream-io/transliterate';
|
|
|
20
20
|
import * as i8 from 'angular-mentions';
|
|
21
21
|
import { MentionModule } from 'angular-mentions';
|
|
22
22
|
|
|
23
|
-
const version = '4.58.
|
|
23
|
+
const version = '4.58.2';
|
|
24
24
|
|
|
25
25
|
/**
|
|
26
26
|
* The `NotificationService` can be used to add or remove notifications. By default the [`NotificationList`](../components/NotificationListComponent.mdx) component displays the currently active notifications.
|
|
@@ -705,7 +705,7 @@ class ChannelService {
|
|
|
705
705
|
return __awaiter(this, void 0, void 0, function* () {
|
|
706
706
|
const channel = this.activeChannelSubject.getValue();
|
|
707
707
|
channel.state.addMessageSorted(Object.assign(Object.assign({}, message), { errorStatusCode: undefined, status: 'sending' }), true);
|
|
708
|
-
|
|
708
|
+
return this.sendMessageRequest(message, undefined, true);
|
|
709
709
|
});
|
|
710
710
|
}
|
|
711
711
|
/**
|
|
@@ -898,8 +898,8 @@ class ChannelService {
|
|
|
898
898
|
this.watchForChannelEvents(channel);
|
|
899
899
|
}
|
|
900
900
|
}
|
|
901
|
-
sendMessageRequest(preview, customData) {
|
|
902
|
-
var _a;
|
|
901
|
+
sendMessageRequest(preview, customData, isResend = false) {
|
|
902
|
+
var _a, _b, _c, _d;
|
|
903
903
|
return __awaiter(this, void 0, void 0, function* () {
|
|
904
904
|
const channel = this.activeChannelSubject.getValue();
|
|
905
905
|
const isThreadReply = !!preview.parent_id;
|
|
@@ -925,10 +925,18 @@ class ChannelService {
|
|
|
925
925
|
}
|
|
926
926
|
catch (error) {
|
|
927
927
|
const stringError = JSON.stringify(error);
|
|
928
|
-
const parsedError = stringError
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
928
|
+
const parsedError = stringError ? JSON.parse(stringError) : {};
|
|
929
|
+
let isAlreadyExists = false;
|
|
930
|
+
if (isResend) {
|
|
931
|
+
if (parsedError.status === 400 &&
|
|
932
|
+
parsedError.code === 4 &&
|
|
933
|
+
((_d = (_c = (_b = parsedError === null || parsedError === void 0 ? void 0 : parsedError.response) === null || _b === void 0 ? void 0 : _b.data) === null || _c === void 0 ? void 0 : _c.message) === null || _d === void 0 ? void 0 : _d.includes('already exists'))) {
|
|
934
|
+
isAlreadyExists = true;
|
|
935
|
+
}
|
|
936
|
+
}
|
|
937
|
+
channel.state.addMessageSorted(Object.assign(Object.assign({}, preview), { errorStatusCode: isAlreadyExists
|
|
938
|
+
? undefined
|
|
939
|
+
: parsedError.status || undefined, status: isAlreadyExists ? 'received' : 'failed' }), true);
|
|
932
940
|
isThreadReply
|
|
933
941
|
? this.activeThreadMessagesSubject.next([
|
|
934
942
|
...channel.state.threads[preview.parent_id],
|