@stream-io/feeds-client 0.2.16 → 0.2.18
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/CHANGELOG.md +21 -0
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/react-bindings.js +1 -1
- package/dist/es/index.mjs +2 -2
- package/dist/es/react-bindings.mjs +1 -1
- package/dist/{index-CaFrpjpl.js → index--koeDtxd.js} +310 -80
- package/dist/index--koeDtxd.js.map +1 -0
- package/dist/{index-J3MkoYPN.mjs → index-Zde8UE5f.mjs} +310 -80
- package/dist/index-Zde8UE5f.mjs.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/common/real-time/StableWSConnection.d.ts +3 -3
- package/dist/types/feed/event-handlers/activity/handle-activity-added.d.ts +4 -3
- package/dist/types/feed/event-handlers/activity/handle-activity-added.d.ts.map +1 -1
- package/dist/types/feed/event-handlers/activity/handle-activity-reaction-updated.d.ts +14 -0
- package/dist/types/feed/event-handlers/activity/handle-activity-reaction-updated.d.ts.map +1 -0
- package/dist/types/feed/event-handlers/activity/handle-activity-updated.d.ts.map +1 -1
- package/dist/types/feed/event-handlers/activity/index.d.ts +1 -0
- package/dist/types/feed/event-handlers/activity/index.d.ts.map +1 -1
- package/dist/types/feed/event-handlers/activity-updater.d.ts +44 -0
- package/dist/types/feed/event-handlers/activity-updater.d.ts.map +1 -0
- package/dist/types/feed/event-handlers/add-aggregated-activities-to-state.d.ts +6 -0
- package/dist/types/feed/event-handlers/add-aggregated-activities-to-state.d.ts.map +1 -0
- package/dist/types/feed/event-handlers/comment/handle-comment-reaction-added.d.ts.map +1 -1
- package/dist/types/feed/event-handlers/comment/handle-comment-reaction-updated.d.ts +6 -0
- package/dist/types/feed/event-handlers/comment/handle-comment-reaction-updated.d.ts.map +1 -0
- package/dist/types/feed/event-handlers/comment/index.d.ts +1 -0
- package/dist/types/feed/event-handlers/comment/index.d.ts.map +1 -1
- package/dist/types/feed/event-handlers/index.d.ts +3 -1
- package/dist/types/feed/event-handlers/index.d.ts.map +1 -1
- package/dist/types/feed/event-handlers/{aggregated-feed/handle-aggregated-feed-updated.d.ts → notification-feed/handle-notification-feed-updated.d.ts} +2 -11
- package/dist/types/feed/event-handlers/notification-feed/handle-notification-feed-updated.d.ts.map +1 -0
- package/dist/types/feed/event-handlers/notification-feed/index.d.ts +2 -0
- package/dist/types/feed/event-handlers/notification-feed/index.d.ts.map +1 -0
- package/dist/types/feed/event-handlers/story-feeds/handle-story-feeds-updated.d.ts +15 -0
- package/dist/types/feed/event-handlers/story-feeds/handle-story-feeds-updated.d.ts.map +1 -0
- package/dist/types/feed/event-handlers/story-feeds/index.d.ts +2 -0
- package/dist/types/feed/event-handlers/story-feeds/index.d.ts.map +1 -0
- package/dist/types/feed/feed.d.ts +9 -3
- package/dist/types/feed/feed.d.ts.map +1 -1
- package/dist/types/feeds-client/feeds-client.d.ts +5 -3
- package/dist/types/feeds-client/feeds-client.d.ts.map +1 -1
- package/dist/types/gen/feeds/FeedsApi.d.ts.map +1 -1
- package/dist/types/gen/models/index.d.ts +43 -452
- package/dist/types/gen/models/index.d.ts.map +1 -1
- package/dist/types/utils/state-update-queue.d.ts +5 -1
- package/dist/types/utils/state-update-queue.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/feed/event-handlers/activity/handle-activity-added.test.ts +16 -5
- package/src/feed/event-handlers/activity/handle-activity-added.ts +9 -11
- package/src/feed/event-handlers/activity/handle-activity-reaction-updated.test.ts +282 -0
- package/src/feed/event-handlers/activity/handle-activity-reaction-updated.ts +140 -0
- package/src/feed/event-handlers/activity/handle-activity-updated.ts +8 -16
- package/src/feed/event-handlers/activity/index.ts +1 -0
- package/src/feed/event-handlers/activity-updater.ts +15 -0
- package/src/feed/event-handlers/add-aggregated-activities-to-state.test.ts +510 -0
- package/src/feed/event-handlers/add-aggregated-activities-to-state.ts +72 -0
- package/src/feed/event-handlers/comment/handle-comment-reaction-added.ts +1 -2
- package/src/feed/event-handlers/comment/handle-comment-reaction-updated.test.ts +350 -0
- package/src/feed/event-handlers/comment/handle-comment-reaction-updated.ts +72 -0
- package/src/feed/event-handlers/comment/index.ts +1 -1
- package/src/feed/event-handlers/index.ts +3 -1
- package/src/feed/event-handlers/notification-feed/handle-notification-feed-updated.test.ts +182 -0
- package/src/feed/event-handlers/{aggregated-feed/handle-aggregated-feed-updated.ts → notification-feed/handle-notification-feed-updated.ts} +2 -94
- package/src/feed/event-handlers/notification-feed/index.ts +1 -0
- package/src/feed/event-handlers/story-feeds/handle-story-feeds-updated.test.ts +45 -0
- package/src/feed/event-handlers/story-feeds/handle-story-feeds-updated.ts +122 -0
- package/src/feed/event-handlers/story-feeds/index.ts +1 -0
- package/src/feed/feed.ts +16 -2
- package/src/feeds-client/feeds-client.ts +36 -6
- package/src/gen/feeds/FeedsApi.ts +5 -0
- package/src/gen/model-decoders/decoders.ts +10 -4
- package/src/gen/models/index.ts +76 -835
- package/src/test-utils/response-generators.ts +89 -1
- package/src/utils/state-update-queue.ts +14 -2
- package/dist/index-CaFrpjpl.js.map +0 -1
- package/dist/index-J3MkoYPN.mjs.map +0 -1
- package/dist/types/feed/event-handlers/aggregated-feed/handle-aggregated-feed-updated.d.ts.map +0 -1
- package/dist/types/feed/event-handlers/aggregated-feed/index.d.ts +0 -2
- package/dist/types/feed/event-handlers/aggregated-feed/index.d.ts.map +0 -1
- package/src/feed/event-handlers/activity/activity-utils.test.ts +0 -252
- package/src/feed/event-handlers/aggregated-feed/handle-aggregated-feed-updated.test.ts +0 -644
- package/src/feed/event-handlers/aggregated-feed/index.ts +0 -1
|
@@ -871,8 +871,9 @@ decoders.MessageResponse = (input) => {
|
|
|
871
871
|
decoders.ModerationCustomActionEvent = (input) => {
|
|
872
872
|
const typeMappings = {
|
|
873
873
|
created_at: { type: "DatetimeType", isSingle: true },
|
|
874
|
-
|
|
875
|
-
|
|
874
|
+
review_queue_item: { type: "ReviewQueueItemResponse", isSingle: true },
|
|
875
|
+
received_at: { type: "DatetimeType", isSingle: true },
|
|
876
|
+
message: { type: "MessageResponse", isSingle: true }
|
|
876
877
|
};
|
|
877
878
|
return decode(typeMappings, input);
|
|
878
879
|
};
|
|
@@ -895,8 +896,9 @@ decoders.ModerationFlaggedEvent = (input) => {
|
|
|
895
896
|
decoders.ModerationMarkReviewedEvent = (input) => {
|
|
896
897
|
const typeMappings = {
|
|
897
898
|
created_at: { type: "DatetimeType", isSingle: true },
|
|
898
|
-
|
|
899
|
-
|
|
899
|
+
item: { type: "ReviewQueueItemResponse", isSingle: true },
|
|
900
|
+
received_at: { type: "DatetimeType", isSingle: true },
|
|
901
|
+
message: { type: "MessageResponse", isSingle: true }
|
|
900
902
|
};
|
|
901
903
|
return decode(typeMappings, input);
|
|
902
904
|
};
|
|
@@ -1250,6 +1252,7 @@ decoders.StoriesFeedUpdatedEvent = (input) => {
|
|
|
1250
1252
|
const typeMappings = {
|
|
1251
1253
|
created_at: { type: "DatetimeType", isSingle: true },
|
|
1252
1254
|
received_at: { type: "DatetimeType", isSingle: true },
|
|
1255
|
+
activities: { type: "ActivityResponse", isSingle: false },
|
|
1253
1256
|
aggregated_activities: {
|
|
1254
1257
|
type: "AggregatedActivityResponse",
|
|
1255
1258
|
isSingle: false
|
|
@@ -1471,6 +1474,8 @@ class FeedsApi {
|
|
|
1471
1474
|
const body = {
|
|
1472
1475
|
name: request?.name,
|
|
1473
1476
|
words: request?.words,
|
|
1477
|
+
is_leet_check_enabled: request?.is_leet_check_enabled,
|
|
1478
|
+
is_plural_check_enabled: request?.is_plural_check_enabled,
|
|
1474
1479
|
team: request?.team,
|
|
1475
1480
|
type: request?.type
|
|
1476
1481
|
};
|
|
@@ -1506,6 +1511,8 @@ class FeedsApi {
|
|
|
1506
1511
|
name: request?.name
|
|
1507
1512
|
};
|
|
1508
1513
|
const body = {
|
|
1514
|
+
is_leet_check_enabled: request?.is_leet_check_enabled,
|
|
1515
|
+
is_plural_check_enabled: request?.is_plural_check_enabled,
|
|
1509
1516
|
team: request?.team,
|
|
1510
1517
|
words: request?.words
|
|
1511
1518
|
};
|
|
@@ -1702,7 +1709,8 @@ class FeedsApi {
|
|
|
1702
1709
|
mute_user: request?.mute_user,
|
|
1703
1710
|
reason: request?.reason,
|
|
1704
1711
|
report: request?.report,
|
|
1705
|
-
show_less: request?.show_less
|
|
1712
|
+
show_less: request?.show_less,
|
|
1713
|
+
show_more: request?.show_more
|
|
1706
1714
|
};
|
|
1707
1715
|
const response = await this.apiClient.sendRequest(
|
|
1708
1716
|
"POST",
|
|
@@ -3722,7 +3730,7 @@ const getRateLimitFromResponseHeader = (response_headers) => {
|
|
|
3722
3730
|
};
|
|
3723
3731
|
return result;
|
|
3724
3732
|
};
|
|
3725
|
-
const version = "0.2.
|
|
3733
|
+
const version = "0.2.18";
|
|
3726
3734
|
class ApiClient {
|
|
3727
3735
|
constructor(apiKey, tokenManager, connectionIdManager, options) {
|
|
3728
3736
|
this.apiKey = apiKey;
|
|
@@ -4531,14 +4539,16 @@ function getStateUpdateQueueId(...args) {
|
|
|
4531
4539
|
return toJoin.concat([data.activity.id]).join("-");
|
|
4532
4540
|
}
|
|
4533
4541
|
case "activity-reaction-created":
|
|
4534
|
-
case "activity-reaction-deleted":
|
|
4542
|
+
case "activity-reaction-deleted":
|
|
4543
|
+
case "activity-reaction-updated": {
|
|
4535
4544
|
return toJoin.concat([
|
|
4536
4545
|
data.activity.id,
|
|
4537
4546
|
data.reaction.type
|
|
4538
4547
|
]).join("-");
|
|
4539
4548
|
}
|
|
4540
4549
|
case "comment-reaction-created":
|
|
4541
|
-
case "comment-reaction-deleted":
|
|
4550
|
+
case "comment-reaction-deleted":
|
|
4551
|
+
case "comment-reaction-updated": {
|
|
4542
4552
|
return toJoin.concat([
|
|
4543
4553
|
data.comment.id,
|
|
4544
4554
|
data.reaction.type
|
|
@@ -4898,7 +4908,6 @@ function handleCommentReactionAdded(payload, fromWs) {
|
|
|
4898
4908
|
newComments[commentIndex] = {
|
|
4899
4909
|
...newComments[commentIndex],
|
|
4900
4910
|
reaction_count: comment.reaction_count ?? 0,
|
|
4901
|
-
// TODO: FIXME this should be handled by the backend
|
|
4902
4911
|
latest_reactions: comment.latest_reactions ?? [],
|
|
4903
4912
|
reaction_groups: comment.reaction_groups ?? {},
|
|
4904
4913
|
own_reactions: ownReactions
|
|
@@ -4963,6 +4972,51 @@ function handleCommentReactionDeleted(payload, fromWs) {
|
|
|
4963
4972
|
};
|
|
4964
4973
|
});
|
|
4965
4974
|
}
|
|
4975
|
+
function handleCommentReactionUpdated(payload, fromWs) {
|
|
4976
|
+
const { comment, reaction } = payload;
|
|
4977
|
+
const connectedUser = this.client.state.getLatestValue().connected_user;
|
|
4978
|
+
const isOwnReaction = reaction.user.id === connectedUser?.id;
|
|
4979
|
+
if (!shouldUpdateState({
|
|
4980
|
+
stateUpdateQueueId: getStateUpdateQueueId(
|
|
4981
|
+
payload,
|
|
4982
|
+
"comment-reaction-updated"
|
|
4983
|
+
),
|
|
4984
|
+
stateUpdateQueue: this.stateUpdateQueue,
|
|
4985
|
+
watch: this.currentState.watch,
|
|
4986
|
+
fromWs,
|
|
4987
|
+
isTriggeredByConnectedUser: isOwnReaction
|
|
4988
|
+
})) {
|
|
4989
|
+
return;
|
|
4990
|
+
}
|
|
4991
|
+
this.state.next((currentState) => {
|
|
4992
|
+
const commentIndex = this.getCommentIndex(comment, currentState);
|
|
4993
|
+
if (commentIndex === -1) return currentState;
|
|
4994
|
+
const forId = comment.parent_id ?? comment.object_id;
|
|
4995
|
+
const entityState = currentState.comments_by_entity_id[forId];
|
|
4996
|
+
const newComments = entityState?.comments?.concat([]) ?? [];
|
|
4997
|
+
let ownReactions = newComments[commentIndex].own_reactions;
|
|
4998
|
+
if (isOwnReaction) {
|
|
4999
|
+
ownReactions = [reaction];
|
|
5000
|
+
}
|
|
5001
|
+
newComments[commentIndex] = {
|
|
5002
|
+
...newComments[commentIndex],
|
|
5003
|
+
reaction_count: comment.reaction_count ?? 0,
|
|
5004
|
+
latest_reactions: comment.latest_reactions ?? [],
|
|
5005
|
+
reaction_groups: comment.reaction_groups ?? {},
|
|
5006
|
+
own_reactions: ownReactions
|
|
5007
|
+
};
|
|
5008
|
+
return {
|
|
5009
|
+
...currentState,
|
|
5010
|
+
comments_by_entity_id: {
|
|
5011
|
+
...currentState.comments_by_entity_id,
|
|
5012
|
+
[forId]: {
|
|
5013
|
+
...entityState,
|
|
5014
|
+
comments: newComments
|
|
5015
|
+
}
|
|
5016
|
+
}
|
|
5017
|
+
};
|
|
5018
|
+
});
|
|
5019
|
+
}
|
|
4966
5020
|
function handleFeedMemberAdded(event) {
|
|
4967
5021
|
const { connected_user: connectedUser } = this.client.state.getLatestValue();
|
|
4968
5022
|
this.state.next((currentState) => {
|
|
@@ -5026,7 +5080,7 @@ function handleFeedMemberRemoved(event) {
|
|
|
5026
5080
|
return newState ?? currentState;
|
|
5027
5081
|
});
|
|
5028
5082
|
}
|
|
5029
|
-
const sharedUpdateActivity$
|
|
5083
|
+
const sharedUpdateActivity$6 = ({
|
|
5030
5084
|
currentActivity,
|
|
5031
5085
|
event,
|
|
5032
5086
|
eventBelongsToCurrentUser
|
|
@@ -5044,7 +5098,7 @@ const sharedUpdateActivity$5 = ({
|
|
|
5044
5098
|
const addBookmarkToActivities = (event, activities, eventBelongsToCurrentUser) => updateEntityInArray({
|
|
5045
5099
|
entities: activities,
|
|
5046
5100
|
matcher: (activity) => activity.id === event.bookmark.activity.id,
|
|
5047
|
-
updater: (matchedActivity) => sharedUpdateActivity$
|
|
5101
|
+
updater: (matchedActivity) => sharedUpdateActivity$6({
|
|
5048
5102
|
currentActivity: matchedActivity,
|
|
5049
5103
|
event,
|
|
5050
5104
|
eventBelongsToCurrentUser
|
|
@@ -5054,7 +5108,7 @@ const addBookmarkToPinnedActivities = (event, pinnedActivities, eventBelongsToCu
|
|
|
5054
5108
|
entities: pinnedActivities,
|
|
5055
5109
|
matcher: (pinnedActivity) => pinnedActivity.activity.id === event.bookmark.activity.id,
|
|
5056
5110
|
updater: (matchedPinnedActivity) => {
|
|
5057
|
-
const newActivity = sharedUpdateActivity$
|
|
5111
|
+
const newActivity = sharedUpdateActivity$6({
|
|
5058
5112
|
currentActivity: matchedPinnedActivity.activity,
|
|
5059
5113
|
event,
|
|
5060
5114
|
eventBelongsToCurrentUser
|
|
@@ -5097,7 +5151,7 @@ function handleBookmarkAdded(event) {
|
|
|
5097
5151
|
const isSameBookmark = (bookmark1, bookmark2) => {
|
|
5098
5152
|
return bookmark1.user.id === bookmark2.user.id && bookmark1.activity.id === bookmark2.activity.id && bookmark1.folder?.id === bookmark2.folder?.id;
|
|
5099
5153
|
};
|
|
5100
|
-
const sharedUpdateActivity$
|
|
5154
|
+
const sharedUpdateActivity$5 = ({
|
|
5101
5155
|
currentActivity,
|
|
5102
5156
|
event,
|
|
5103
5157
|
eventBelongsToCurrentUser
|
|
@@ -5117,7 +5171,7 @@ const sharedUpdateActivity$4 = ({
|
|
|
5117
5171
|
const removeBookmarkFromActivities = (event, activities, eventBelongsToCurrentUser) => updateEntityInArray({
|
|
5118
5172
|
entities: activities,
|
|
5119
5173
|
matcher: (activity) => activity.id === event.bookmark.activity.id,
|
|
5120
|
-
updater: (matchedActivity) => sharedUpdateActivity$
|
|
5174
|
+
updater: (matchedActivity) => sharedUpdateActivity$5({
|
|
5121
5175
|
currentActivity: matchedActivity,
|
|
5122
5176
|
event,
|
|
5123
5177
|
eventBelongsToCurrentUser
|
|
@@ -5127,7 +5181,7 @@ const removeBookmarkFromPinnedActivities = (event, pinnedActivities, eventBelong
|
|
|
5127
5181
|
entities: pinnedActivities,
|
|
5128
5182
|
matcher: (pinnedActivity) => pinnedActivity.activity.id === event.bookmark.activity.id,
|
|
5129
5183
|
updater: (matchedPinnedActivity) => {
|
|
5130
|
-
const newActivity = sharedUpdateActivity$
|
|
5184
|
+
const newActivity = sharedUpdateActivity$5({
|
|
5131
5185
|
currentActivity: matchedPinnedActivity.activity,
|
|
5132
5186
|
event,
|
|
5133
5187
|
eventBelongsToCurrentUser
|
|
@@ -5167,7 +5221,7 @@ function handleBookmarkDeleted(event) {
|
|
|
5167
5221
|
});
|
|
5168
5222
|
}
|
|
5169
5223
|
}
|
|
5170
|
-
const sharedUpdateActivity$
|
|
5224
|
+
const sharedUpdateActivity$4 = ({
|
|
5171
5225
|
currentActivity,
|
|
5172
5226
|
event,
|
|
5173
5227
|
eventBelongsToCurrentUser
|
|
@@ -5191,7 +5245,7 @@ const sharedUpdateActivity$3 = ({
|
|
|
5191
5245
|
const updateBookmarkInActivities = (event, activities, eventBelongsToCurrentUser) => updateEntityInArray({
|
|
5192
5246
|
entities: activities,
|
|
5193
5247
|
matcher: (activity) => activity.id === event.bookmark.activity.id,
|
|
5194
|
-
updater: (matchedActivity) => sharedUpdateActivity$
|
|
5248
|
+
updater: (matchedActivity) => sharedUpdateActivity$4({
|
|
5195
5249
|
currentActivity: matchedActivity,
|
|
5196
5250
|
event,
|
|
5197
5251
|
eventBelongsToCurrentUser
|
|
@@ -5201,7 +5255,7 @@ const updateBookmarkInPinnedActivities = (event, pinnedActivities, eventBelongsT
|
|
|
5201
5255
|
entities: pinnedActivities,
|
|
5202
5256
|
matcher: (pinnedActivity) => pinnedActivity.activity.id === event.bookmark.activity.id,
|
|
5203
5257
|
updater: (matchedPinnedActivity) => {
|
|
5204
|
-
const newActivity = sharedUpdateActivity$
|
|
5258
|
+
const newActivity = sharedUpdateActivity$4({
|
|
5205
5259
|
currentActivity: matchedPinnedActivity.activity,
|
|
5206
5260
|
event,
|
|
5207
5261
|
eventBelongsToCurrentUser
|
|
@@ -5242,19 +5296,16 @@ function handleBookmarkUpdated(event) {
|
|
|
5242
5296
|
}
|
|
5243
5297
|
}
|
|
5244
5298
|
function addActivitiesToState(newActivities, activities, position) {
|
|
5245
|
-
let result;
|
|
5246
5299
|
if (activities === void 0) {
|
|
5247
|
-
|
|
5248
|
-
result = {
|
|
5249
|
-
changed: true,
|
|
5250
|
-
activities
|
|
5251
|
-
};
|
|
5252
|
-
} else {
|
|
5253
|
-
result = {
|
|
5300
|
+
return {
|
|
5254
5301
|
changed: false,
|
|
5255
|
-
activities
|
|
5302
|
+
activities: []
|
|
5256
5303
|
};
|
|
5257
5304
|
}
|
|
5305
|
+
let result = {
|
|
5306
|
+
changed: false,
|
|
5307
|
+
activities
|
|
5308
|
+
};
|
|
5258
5309
|
const newActivitiesDeduplicated = [];
|
|
5259
5310
|
newActivities.forEach((newActivityResponse) => {
|
|
5260
5311
|
if (!this.hasActivity(newActivityResponse.id)) {
|
|
@@ -5276,7 +5327,7 @@ function handleActivityAdded(event) {
|
|
|
5276
5327
|
const result = addActivitiesToState.bind(this)(
|
|
5277
5328
|
[event.activity],
|
|
5278
5329
|
currentActivities,
|
|
5279
|
-
|
|
5330
|
+
this.currentState.addNewActivitiesTo
|
|
5280
5331
|
);
|
|
5281
5332
|
if (result.changed) {
|
|
5282
5333
|
this.client.hydratePollCache([event.activity]);
|
|
@@ -5332,31 +5383,32 @@ function handleActivityRemovedFromFeed(event) {
|
|
|
5332
5383
|
}
|
|
5333
5384
|
}
|
|
5334
5385
|
}
|
|
5335
|
-
const
|
|
5386
|
+
const updateActivity = ({
|
|
5336
5387
|
currentActivity,
|
|
5337
|
-
|
|
5388
|
+
newActivtiy
|
|
5338
5389
|
}) => {
|
|
5339
5390
|
return {
|
|
5340
|
-
...
|
|
5391
|
+
...newActivtiy,
|
|
5341
5392
|
own_reactions: currentActivity.own_reactions,
|
|
5342
5393
|
own_bookmarks: currentActivity.own_bookmarks
|
|
5343
5394
|
};
|
|
5344
5395
|
};
|
|
5396
|
+
const sharedUpdateActivity$3 = updateActivity;
|
|
5345
5397
|
const updateActivityInState = (event, activities) => updateEntityInArray({
|
|
5346
5398
|
entities: activities,
|
|
5347
5399
|
matcher: (activity) => activity.id === event.activity.id,
|
|
5348
|
-
updater: (matchedActivity) => sharedUpdateActivity$
|
|
5400
|
+
updater: (matchedActivity) => sharedUpdateActivity$3({
|
|
5349
5401
|
currentActivity: matchedActivity,
|
|
5350
|
-
event
|
|
5402
|
+
newActivtiy: event.activity
|
|
5351
5403
|
})
|
|
5352
5404
|
});
|
|
5353
5405
|
const updatePinnedActivityInState = (event, pinnedActivities) => updateEntityInArray({
|
|
5354
5406
|
entities: pinnedActivities,
|
|
5355
5407
|
matcher: (pinnedActivity) => pinnedActivity.activity.id === event.activity.id,
|
|
5356
5408
|
updater: (matchedPinnedActivity) => {
|
|
5357
|
-
const newActivity = sharedUpdateActivity$
|
|
5409
|
+
const newActivity = sharedUpdateActivity$3({
|
|
5358
5410
|
currentActivity: matchedPinnedActivity.activity,
|
|
5359
|
-
event
|
|
5411
|
+
newActivtiy: event.activity
|
|
5360
5412
|
});
|
|
5361
5413
|
if (newActivity === matchedPinnedActivity.activity) {
|
|
5362
5414
|
return matchedPinnedActivity;
|
|
@@ -5396,7 +5448,7 @@ function handleActivityUpdated(payload, fromWs) {
|
|
|
5396
5448
|
});
|
|
5397
5449
|
}
|
|
5398
5450
|
}
|
|
5399
|
-
const sharedUpdateActivity$
|
|
5451
|
+
const sharedUpdateActivity$2 = ({
|
|
5400
5452
|
payload,
|
|
5401
5453
|
currentActivity,
|
|
5402
5454
|
eventBelongsToCurrentUser
|
|
@@ -5417,7 +5469,7 @@ const sharedUpdateActivity$1 = ({
|
|
|
5417
5469
|
const addReactionToActivities = (payload, activities, eventBelongsToCurrentUser) => updateEntityInArray({
|
|
5418
5470
|
entities: activities,
|
|
5419
5471
|
matcher: (activity) => activity.id === payload.activity.id,
|
|
5420
|
-
updater: (matchedActivity) => sharedUpdateActivity$
|
|
5472
|
+
updater: (matchedActivity) => sharedUpdateActivity$2({
|
|
5421
5473
|
payload,
|
|
5422
5474
|
currentActivity: matchedActivity,
|
|
5423
5475
|
eventBelongsToCurrentUser
|
|
@@ -5427,7 +5479,7 @@ const addReactionToPinnedActivities = (payload, pinnedActivities, eventBelongsTo
|
|
|
5427
5479
|
entities: pinnedActivities,
|
|
5428
5480
|
matcher: (pinnedActivity) => pinnedActivity.activity.id === payload.activity.id,
|
|
5429
5481
|
updater: (matchedPinnedActivity) => {
|
|
5430
|
-
const updatedActivity = sharedUpdateActivity$
|
|
5482
|
+
const updatedActivity = sharedUpdateActivity$2({
|
|
5431
5483
|
payload,
|
|
5432
5484
|
currentActivity: matchedPinnedActivity.activity,
|
|
5433
5485
|
eventBelongsToCurrentUser
|
|
@@ -5479,7 +5531,7 @@ function handleActivityReactionAdded(payload, fromWs) {
|
|
|
5479
5531
|
});
|
|
5480
5532
|
}
|
|
5481
5533
|
}
|
|
5482
|
-
const sharedUpdateActivity = ({
|
|
5534
|
+
const sharedUpdateActivity$1 = ({
|
|
5483
5535
|
currentActivity,
|
|
5484
5536
|
payload,
|
|
5485
5537
|
eventBelongsToCurrentUser
|
|
@@ -5502,7 +5554,7 @@ const sharedUpdateActivity = ({
|
|
|
5502
5554
|
const removeReactionFromActivities = (payload, activities, eventBelongsToCurrentUser) => updateEntityInArray({
|
|
5503
5555
|
entities: activities,
|
|
5504
5556
|
matcher: (activity) => activity.id === payload.activity.id,
|
|
5505
|
-
updater: (matchedActivity) => sharedUpdateActivity({
|
|
5557
|
+
updater: (matchedActivity) => sharedUpdateActivity$1({
|
|
5506
5558
|
currentActivity: matchedActivity,
|
|
5507
5559
|
payload,
|
|
5508
5560
|
eventBelongsToCurrentUser
|
|
@@ -5512,7 +5564,7 @@ const removeReactionFromPinnedActivities = (payload, activities, eventBelongsToC
|
|
|
5512
5564
|
entities: activities,
|
|
5513
5565
|
matcher: (pinnedActivity) => pinnedActivity.activity.id === payload.activity.id,
|
|
5514
5566
|
updater: (matchedPinnedActivity) => {
|
|
5515
|
-
const newActivity = sharedUpdateActivity({
|
|
5567
|
+
const newActivity = sharedUpdateActivity$1({
|
|
5516
5568
|
currentActivity: matchedPinnedActivity.activity,
|
|
5517
5569
|
payload,
|
|
5518
5570
|
eventBelongsToCurrentUser
|
|
@@ -5564,6 +5616,89 @@ function handleActivityReactionDeleted(payload, fromWs) {
|
|
|
5564
5616
|
});
|
|
5565
5617
|
}
|
|
5566
5618
|
}
|
|
5619
|
+
const sharedUpdateActivity = ({
|
|
5620
|
+
payload,
|
|
5621
|
+
currentActivity,
|
|
5622
|
+
eventBelongsToCurrentUser
|
|
5623
|
+
}) => {
|
|
5624
|
+
const { activity: newActivity, reaction: newReaction } = payload;
|
|
5625
|
+
let ownReactions = currentActivity.own_reactions;
|
|
5626
|
+
if (eventBelongsToCurrentUser) {
|
|
5627
|
+
ownReactions = [newReaction];
|
|
5628
|
+
}
|
|
5629
|
+
return {
|
|
5630
|
+
...currentActivity,
|
|
5631
|
+
latest_reactions: newActivity.latest_reactions,
|
|
5632
|
+
reaction_groups: newActivity.reaction_groups,
|
|
5633
|
+
reaction_count: newActivity.reaction_count,
|
|
5634
|
+
own_reactions: ownReactions
|
|
5635
|
+
};
|
|
5636
|
+
};
|
|
5637
|
+
const updateReactionInActivities = (payload, activities, eventBelongsToCurrentUser) => updateEntityInArray({
|
|
5638
|
+
entities: activities,
|
|
5639
|
+
matcher: (activity) => activity.id === payload.activity.id,
|
|
5640
|
+
updater: (matchedActivity) => sharedUpdateActivity({
|
|
5641
|
+
payload,
|
|
5642
|
+
currentActivity: matchedActivity,
|
|
5643
|
+
eventBelongsToCurrentUser
|
|
5644
|
+
})
|
|
5645
|
+
});
|
|
5646
|
+
const updateReactionInPinnedActivities = (payload, pinnedActivities, eventBelongsToCurrentUser) => updateEntityInArray({
|
|
5647
|
+
entities: pinnedActivities,
|
|
5648
|
+
matcher: (pinnedActivity) => pinnedActivity.activity.id === payload.activity.id,
|
|
5649
|
+
updater: (matchedPinnedActivity) => {
|
|
5650
|
+
const updatedActivity = sharedUpdateActivity({
|
|
5651
|
+
payload,
|
|
5652
|
+
currentActivity: matchedPinnedActivity.activity,
|
|
5653
|
+
eventBelongsToCurrentUser
|
|
5654
|
+
});
|
|
5655
|
+
if (updatedActivity === matchedPinnedActivity.activity) {
|
|
5656
|
+
return matchedPinnedActivity;
|
|
5657
|
+
}
|
|
5658
|
+
return {
|
|
5659
|
+
...matchedPinnedActivity,
|
|
5660
|
+
activity: updatedActivity
|
|
5661
|
+
};
|
|
5662
|
+
}
|
|
5663
|
+
});
|
|
5664
|
+
function handleActivityReactionUpdated(payload, fromWs) {
|
|
5665
|
+
const connectedUser = this.client.state.getLatestValue().connected_user;
|
|
5666
|
+
const eventBelongsToCurrentUser = typeof connectedUser !== "undefined" && payload.reaction.user.id === connectedUser.id;
|
|
5667
|
+
if (!shouldUpdateState({
|
|
5668
|
+
stateUpdateQueueId: getStateUpdateQueueId(
|
|
5669
|
+
payload,
|
|
5670
|
+
"activity-reaction-updated"
|
|
5671
|
+
),
|
|
5672
|
+
stateUpdateQueue: this.stateUpdateQueue,
|
|
5673
|
+
watch: this.currentState.watch,
|
|
5674
|
+
fromWs,
|
|
5675
|
+
isTriggeredByConnectedUser: eventBelongsToCurrentUser
|
|
5676
|
+
})) {
|
|
5677
|
+
return;
|
|
5678
|
+
}
|
|
5679
|
+
const {
|
|
5680
|
+
activities: currentActivities,
|
|
5681
|
+
pinned_activities: currentPinnedActivities
|
|
5682
|
+
} = this.currentState;
|
|
5683
|
+
const [result1, result2] = [
|
|
5684
|
+
this.hasActivity(payload.activity.id) ? updateReactionInActivities(
|
|
5685
|
+
payload,
|
|
5686
|
+
currentActivities,
|
|
5687
|
+
eventBelongsToCurrentUser
|
|
5688
|
+
) : void 0,
|
|
5689
|
+
updateReactionInPinnedActivities(
|
|
5690
|
+
payload,
|
|
5691
|
+
currentPinnedActivities,
|
|
5692
|
+
eventBelongsToCurrentUser
|
|
5693
|
+
)
|
|
5694
|
+
];
|
|
5695
|
+
if (result1?.changed || result2.changed) {
|
|
5696
|
+
this.state.partialNext({
|
|
5697
|
+
...result1 ? { activities: result1.entities } : {},
|
|
5698
|
+
pinned_activities: result2.entities
|
|
5699
|
+
});
|
|
5700
|
+
}
|
|
5701
|
+
}
|
|
5567
5702
|
const updateNotificationStatusFromActivityMarked = (event, currentNotificationStatus, aggregatedActivities = []) => {
|
|
5568
5703
|
if (!currentNotificationStatus) {
|
|
5569
5704
|
return {
|
|
@@ -5618,36 +5753,55 @@ const addAggregatedActivitiesToState = (newAggregatedActivities, aggregatedActiv
|
|
|
5618
5753
|
if (newAggregatedActivities.length === 0) {
|
|
5619
5754
|
result = {
|
|
5620
5755
|
changed: false,
|
|
5621
|
-
aggregated_activities: []
|
|
5756
|
+
aggregated_activities: aggregatedActivities ?? []
|
|
5622
5757
|
};
|
|
5623
5758
|
} else {
|
|
5624
5759
|
result = {
|
|
5625
5760
|
changed: true,
|
|
5626
5761
|
aggregated_activities: []
|
|
5627
5762
|
};
|
|
5628
|
-
|
|
5629
|
-
|
|
5630
|
-
|
|
5631
|
-
result.aggregated_activities = uniqueArrayMerge(
|
|
5632
|
-
newAggregatedActivities,
|
|
5633
|
-
aggregatedActivities ?? [],
|
|
5634
|
-
(a) => a.group
|
|
5763
|
+
newAggregatedActivities.forEach((newAggregatedActivity) => {
|
|
5764
|
+
const existingAggregatedActivity = aggregatedActivities?.find(
|
|
5765
|
+
(a) => a.group === newAggregatedActivity.group
|
|
5635
5766
|
);
|
|
5636
|
-
|
|
5637
|
-
|
|
5638
|
-
|
|
5639
|
-
|
|
5640
|
-
|
|
5641
|
-
|
|
5642
|
-
|
|
5643
|
-
|
|
5644
|
-
|
|
5645
|
-
|
|
5646
|
-
|
|
5647
|
-
|
|
5648
|
-
|
|
5649
|
-
|
|
5650
|
-
|
|
5767
|
+
if (existingAggregatedActivity) {
|
|
5768
|
+
for (let i = 0; i < newAggregatedActivity.activities.length; i++) {
|
|
5769
|
+
const activity = newAggregatedActivity.activities[i];
|
|
5770
|
+
const existingActivity = existingAggregatedActivity.activities.find(
|
|
5771
|
+
(a) => a.id === activity.id
|
|
5772
|
+
);
|
|
5773
|
+
if (existingActivity) {
|
|
5774
|
+
newAggregatedActivity.activities[i] = updateActivity({
|
|
5775
|
+
currentActivity: existingActivity,
|
|
5776
|
+
newActivtiy: activity
|
|
5777
|
+
});
|
|
5778
|
+
}
|
|
5779
|
+
}
|
|
5780
|
+
}
|
|
5781
|
+
});
|
|
5782
|
+
switch (position) {
|
|
5783
|
+
case "start":
|
|
5784
|
+
result.aggregated_activities = uniqueArrayMerge(
|
|
5785
|
+
newAggregatedActivities,
|
|
5786
|
+
aggregatedActivities ?? [],
|
|
5787
|
+
(a) => a.group
|
|
5788
|
+
);
|
|
5789
|
+
break;
|
|
5790
|
+
case "end":
|
|
5791
|
+
result.aggregated_activities = uniqueArrayMerge(
|
|
5792
|
+
aggregatedActivities ?? [],
|
|
5793
|
+
newAggregatedActivities,
|
|
5794
|
+
(a) => a.group
|
|
5795
|
+
);
|
|
5796
|
+
break;
|
|
5797
|
+
case "replace":
|
|
5798
|
+
result.aggregated_activities = replaceUniqueArrayMerge(
|
|
5799
|
+
aggregatedActivities ?? [],
|
|
5800
|
+
newAggregatedActivities,
|
|
5801
|
+
(a) => a.group
|
|
5802
|
+
);
|
|
5803
|
+
break;
|
|
5804
|
+
}
|
|
5651
5805
|
}
|
|
5652
5806
|
return result;
|
|
5653
5807
|
};
|
|
@@ -5673,7 +5827,7 @@ const updateNotificationStatus = (newNotificationStatus, currentNotificationStat
|
|
|
5673
5827
|
};
|
|
5674
5828
|
const updateNotificationFeedFromEvent = (event, currentAggregatedActivities, currentNotificationStatus) => {
|
|
5675
5829
|
const updates = {};
|
|
5676
|
-
if (event.notification_status
|
|
5830
|
+
if (event.notification_status) {
|
|
5677
5831
|
const notificationStatusResult = updateNotificationStatus(
|
|
5678
5832
|
event.notification_status,
|
|
5679
5833
|
currentNotificationStatus
|
|
@@ -5715,18 +5869,65 @@ function handleNotificationFeedUpdated(event) {
|
|
|
5715
5869
|
});
|
|
5716
5870
|
}
|
|
5717
5871
|
}
|
|
5718
|
-
|
|
5719
|
-
if (!
|
|
5872
|
+
const updateActivities = (activitiesToUpsert, currentActivities) => {
|
|
5873
|
+
if (!activitiesToUpsert || activitiesToUpsert.length === 0 || !currentActivities) {
|
|
5874
|
+
return {
|
|
5875
|
+
changed: false,
|
|
5876
|
+
activities: currentActivities ?? []
|
|
5877
|
+
};
|
|
5878
|
+
}
|
|
5879
|
+
const result = [];
|
|
5880
|
+
for (let i = 0; i < currentActivities.length; i++) {
|
|
5881
|
+
const activity = currentActivities[i];
|
|
5882
|
+
const updatedActivity = activitiesToUpsert.find(
|
|
5883
|
+
(a) => a.id === activity.id
|
|
5884
|
+
);
|
|
5885
|
+
if (updatedActivity) {
|
|
5886
|
+
result.push(
|
|
5887
|
+
updateActivity({
|
|
5888
|
+
currentActivity: activity,
|
|
5889
|
+
newActivtiy: updatedActivity
|
|
5890
|
+
})
|
|
5891
|
+
);
|
|
5892
|
+
} else {
|
|
5893
|
+
result.push(activity);
|
|
5894
|
+
}
|
|
5895
|
+
}
|
|
5896
|
+
return {
|
|
5897
|
+
changed: true,
|
|
5898
|
+
activities: result
|
|
5899
|
+
};
|
|
5900
|
+
};
|
|
5901
|
+
function updateStoriesFeedFromEvent(aggregatedActivities, activities, event) {
|
|
5902
|
+
if (!aggregatedActivities && event.aggregated_activities && event.aggregated_activities?.length > 0 || !activities && event.activities && event.activities?.length > 0) {
|
|
5720
5903
|
return {
|
|
5721
5904
|
changed: false
|
|
5722
5905
|
};
|
|
5723
5906
|
}
|
|
5907
|
+
const result = {
|
|
5908
|
+
changed: true,
|
|
5909
|
+
data: {
|
|
5910
|
+
aggregated_activities: aggregatedActivities,
|
|
5911
|
+
activities
|
|
5912
|
+
}
|
|
5913
|
+
};
|
|
5724
5914
|
if (event.aggregated_activities) {
|
|
5725
|
-
const
|
|
5915
|
+
const aggregatedActivitiesResult = addAggregatedActivitiesToState(
|
|
5726
5916
|
event.aggregated_activities,
|
|
5727
5917
|
aggregatedActivities,
|
|
5728
5918
|
"replace"
|
|
5729
5919
|
);
|
|
5920
|
+
if (aggregatedActivitiesResult.changed) {
|
|
5921
|
+
result.data.aggregated_activities = aggregatedActivitiesResult.aggregated_activities;
|
|
5922
|
+
}
|
|
5923
|
+
}
|
|
5924
|
+
if (event.activities) {
|
|
5925
|
+
const activitiesResult = updateActivities(event.activities, activities);
|
|
5926
|
+
if (activitiesResult.changed) {
|
|
5927
|
+
result.data.activities = activitiesResult.activities;
|
|
5928
|
+
}
|
|
5929
|
+
}
|
|
5930
|
+
if (event.aggregated_activities || event.activities) {
|
|
5730
5931
|
return result;
|
|
5731
5932
|
}
|
|
5732
5933
|
return {
|
|
@@ -5736,11 +5937,13 @@ function updateStoriesFeedFromEvent(aggregatedActivities, event) {
|
|
|
5736
5937
|
function handleStoriesFeedUpdated(event) {
|
|
5737
5938
|
const result = updateStoriesFeedFromEvent(
|
|
5738
5939
|
this.currentState.aggregated_activities,
|
|
5940
|
+
this.currentState.activities,
|
|
5739
5941
|
event
|
|
5740
5942
|
);
|
|
5741
5943
|
if (result.changed) {
|
|
5742
5944
|
this.state.partialNext({
|
|
5743
|
-
aggregated_activities: result.data?.aggregated_activities
|
|
5945
|
+
aggregated_activities: result.data?.aggregated_activities,
|
|
5946
|
+
activities: result.data?.activities
|
|
5744
5947
|
});
|
|
5745
5948
|
}
|
|
5746
5949
|
}
|
|
@@ -5751,7 +5954,7 @@ function handleWatchStopped() {
|
|
|
5751
5954
|
this.state.partialNext({ watch: false });
|
|
5752
5955
|
}
|
|
5753
5956
|
const _Feed = class _Feed extends FeedApi {
|
|
5754
|
-
constructor(client, groupId, id, data, watch = false) {
|
|
5957
|
+
constructor(client, groupId, id, data, watch = false, addNewActivitiesTo = "start") {
|
|
5755
5958
|
super(client, groupId, id);
|
|
5756
5959
|
this.indexedActivityIds = /* @__PURE__ */ new Set();
|
|
5757
5960
|
this.stateUpdateQueue = /* @__PURE__ */ new Set();
|
|
@@ -5760,7 +5963,7 @@ const _Feed = class _Feed extends FeedApi {
|
|
|
5760
5963
|
"feeds.activity.deleted": handleActivityDeleted.bind(this),
|
|
5761
5964
|
"feeds.activity.reaction.added": handleActivityReactionAdded.bind(this),
|
|
5762
5965
|
"feeds.activity.reaction.deleted": handleActivityReactionDeleted.bind(this),
|
|
5763
|
-
"feeds.activity.reaction.updated":
|
|
5966
|
+
"feeds.activity.reaction.updated": handleActivityReactionUpdated.bind(this),
|
|
5764
5967
|
"feeds.activity.removed_from_feed": handleActivityRemovedFromFeed.bind(this),
|
|
5765
5968
|
"feeds.activity.updated": handleActivityUpdated.bind(this),
|
|
5766
5969
|
"feeds.bookmark.added": handleBookmarkAdded.bind(this),
|
|
@@ -5781,7 +5984,7 @@ const _Feed = class _Feed extends FeedApi {
|
|
|
5781
5984
|
"feeds.follow.updated": handleFollowUpdated.bind(this),
|
|
5782
5985
|
"feeds.comment.reaction.added": handleCommentReactionAdded.bind(this),
|
|
5783
5986
|
"feeds.comment.reaction.deleted": handleCommentReactionDeleted.bind(this),
|
|
5784
|
-
"feeds.comment.reaction.updated":
|
|
5987
|
+
"feeds.comment.reaction.updated": handleCommentReactionUpdated.bind(this),
|
|
5785
5988
|
"feeds.feed_member.added": handleFeedMemberAdded.bind(this),
|
|
5786
5989
|
"feeds.feed_member.removed": handleFeedMemberRemoved.bind(this),
|
|
5787
5990
|
"feeds.feed_member.updated": handleFeedMemberUpdated.bind(this),
|
|
@@ -5819,7 +6022,8 @@ const _Feed = class _Feed extends FeedApi {
|
|
|
5819
6022
|
is_loading: false,
|
|
5820
6023
|
is_loading_activities: false,
|
|
5821
6024
|
comments_by_entity_id: {},
|
|
5822
|
-
watch
|
|
6025
|
+
watch,
|
|
6026
|
+
addNewActivitiesTo
|
|
5823
6027
|
});
|
|
5824
6028
|
this.client = client;
|
|
5825
6029
|
this.state.subscribeWithSelector(
|
|
@@ -5840,6 +6044,9 @@ const _Feed = class _Feed extends FeedApi {
|
|
|
5840
6044
|
get currentState() {
|
|
5841
6045
|
return this.state.getLatestValue();
|
|
5842
6046
|
}
|
|
6047
|
+
set addNewActivitiesTo(value) {
|
|
6048
|
+
this.state.partialNext({ addNewActivitiesTo: value });
|
|
6049
|
+
}
|
|
5843
6050
|
hasActivity(activityId) {
|
|
5844
6051
|
return this.indexedActivityIds.has(activityId);
|
|
5845
6052
|
}
|
|
@@ -6475,9 +6682,14 @@ class FeedsClient extends FeedsApi {
|
|
|
6475
6682
|
return response;
|
|
6476
6683
|
};
|
|
6477
6684
|
this.addActivityReaction = async (request) => {
|
|
6685
|
+
const shouldEnforceUnique = request.enforce_unique;
|
|
6478
6686
|
const response = await super.addActivityReaction(request);
|
|
6479
6687
|
for (const feed of Object.values(this.activeFeeds)) {
|
|
6480
|
-
|
|
6688
|
+
if (shouldEnforceUnique) {
|
|
6689
|
+
handleActivityReactionUpdated.bind(feed)(response, false);
|
|
6690
|
+
} else {
|
|
6691
|
+
handleActivityReactionAdded.bind(feed)(response, false);
|
|
6692
|
+
}
|
|
6481
6693
|
}
|
|
6482
6694
|
return response;
|
|
6483
6695
|
};
|
|
@@ -6492,9 +6704,14 @@ class FeedsClient extends FeedsApi {
|
|
|
6492
6704
|
return response;
|
|
6493
6705
|
};
|
|
6494
6706
|
this.addCommentReaction = async (request) => {
|
|
6707
|
+
const shouldEnforceUnique = request.enforce_unique;
|
|
6495
6708
|
const response = await super.addCommentReaction(request);
|
|
6496
6709
|
for (const feed of Object.values(this.activeFeeds)) {
|
|
6497
|
-
|
|
6710
|
+
if (shouldEnforceUnique) {
|
|
6711
|
+
handleCommentReactionUpdated.bind(feed)(response, false);
|
|
6712
|
+
} else {
|
|
6713
|
+
handleCommentReactionAdded.bind(feed)(response, false);
|
|
6714
|
+
}
|
|
6498
6715
|
}
|
|
6499
6716
|
return response;
|
|
6500
6717
|
};
|
|
@@ -6536,8 +6753,14 @@ class FeedsClient extends FeedsApi {
|
|
|
6536
6753
|
};
|
|
6537
6754
|
this.on = this.eventDispatcher.on;
|
|
6538
6755
|
this.off = this.eventDispatcher.off;
|
|
6539
|
-
this.feed = (groupId, id) => {
|
|
6540
|
-
return this.getOrCreateActiveFeed(
|
|
6756
|
+
this.feed = (groupId, id, options2) => {
|
|
6757
|
+
return this.getOrCreateActiveFeed(
|
|
6758
|
+
groupId,
|
|
6759
|
+
id,
|
|
6760
|
+
void 0,
|
|
6761
|
+
void 0,
|
|
6762
|
+
options2?.addNewActivitiesTo
|
|
6763
|
+
);
|
|
6541
6764
|
};
|
|
6542
6765
|
this.updateNetworkConnectionStatus = (event) => {
|
|
6543
6766
|
const networkEvent = {
|
|
@@ -6546,10 +6769,17 @@ class FeedsClient extends FeedsApi {
|
|
|
6546
6769
|
};
|
|
6547
6770
|
this.eventDispatcher.dispatch(networkEvent);
|
|
6548
6771
|
};
|
|
6549
|
-
this.getOrCreateActiveFeed = (group, id, data, watch) => {
|
|
6772
|
+
this.getOrCreateActiveFeed = (group, id, data, watch, addNewActivitiesTo) => {
|
|
6550
6773
|
const fid = `${group}:${id}`;
|
|
6551
6774
|
if (!this.activeFeeds[fid]) {
|
|
6552
|
-
this.activeFeeds[fid] = new Feed(
|
|
6775
|
+
this.activeFeeds[fid] = new Feed(
|
|
6776
|
+
this,
|
|
6777
|
+
group,
|
|
6778
|
+
id,
|
|
6779
|
+
data,
|
|
6780
|
+
watch,
|
|
6781
|
+
addNewActivitiesTo
|
|
6782
|
+
);
|
|
6553
6783
|
}
|
|
6554
6784
|
const feed = this.activeFeeds[fid];
|
|
6555
6785
|
if (!feed.currentState.watch) {
|
|
@@ -6864,4 +7094,4 @@ export {
|
|
|
6864
7094
|
shouldUpdateState as s,
|
|
6865
7095
|
uniqueArrayMerge as u
|
|
6866
7096
|
};
|
|
6867
|
-
//# sourceMappingURL=index-
|
|
7097
|
+
//# sourceMappingURL=index-Zde8UE5f.mjs.map
|