@stream-io/feeds-client 0.2.12 → 0.2.13

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.
Files changed (26) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/dist/cjs/index.js +1 -1
  3. package/dist/cjs/react-bindings.js +22 -14
  4. package/dist/cjs/react-bindings.js.map +1 -1
  5. package/dist/es/index.mjs +2 -2
  6. package/dist/es/react-bindings.mjs +22 -14
  7. package/dist/es/react-bindings.mjs.map +1 -1
  8. package/dist/{index-o7AeSkxa.js → index-RzB4c4g6.js} +81 -9
  9. package/dist/index-RzB4c4g6.js.map +1 -0
  10. package/dist/{index-D7QtnkUs.mjs → index-gvcJhGPH.mjs} +81 -9
  11. package/dist/index-gvcJhGPH.mjs.map +1 -0
  12. package/dist/tsconfig.tsbuildinfo +1 -1
  13. package/dist/types/bindings/react/hooks/feed-state-hooks/useAggregatedActivities.d.ts +9 -4
  14. package/dist/types/bindings/react/hooks/feed-state-hooks/useAggregatedActivities.d.ts.map +1 -1
  15. package/dist/types/bindings/react/hooks/feed-state-hooks/useIsAggregatedActivityRead.d.ts.map +1 -1
  16. package/dist/types/feed/event-handlers/notification-feed/handle-notification-feed-updated.d.ts +8 -1
  17. package/dist/types/feed/event-handlers/notification-feed/handle-notification-feed-updated.d.ts.map +1 -1
  18. package/dist/types/feed/feed.d.ts.map +1 -1
  19. package/package.json +1 -1
  20. package/src/bindings/react/hooks/feed-state-hooks/useAggregatedActivities.ts +28 -4
  21. package/src/bindings/react/hooks/feed-state-hooks/useIsAggregatedActivityRead.ts +4 -5
  22. package/src/feed/event-handlers/notification-feed/handle-notification-feed-updated.test.ts +309 -11
  23. package/src/feed/event-handlers/notification-feed/handle-notification-feed-updated.ts +89 -6
  24. package/src/feed/feed.ts +21 -1
  25. package/dist/index-D7QtnkUs.mjs.map +0 -1
  26. package/dist/index-o7AeSkxa.js.map +0 -1
package/src/feed/feed.ts CHANGED
@@ -44,6 +44,8 @@ import {
44
44
  handleActivityReactionDeleted,
45
45
  handleCommentReactionAdded,
46
46
  handleCommentReactionDeleted,
47
+ addAggregatedActivitiesToState,
48
+ updateNotificationStatus,
47
49
  } from './event-handlers';
48
50
  import { capitalize } from '../common/utils';
49
51
  import type {
@@ -279,9 +281,27 @@ export class Feed extends FeedApi {
279
281
  'end',
280
282
  );
281
283
 
282
- if (result.changed) {
284
+ const aggregatedActivitiesResult = addAggregatedActivitiesToState(
285
+ response.aggregated_activities,
286
+ this.currentState.aggregated_activities,
287
+ 'end',
288
+ );
289
+
290
+ const notificationStatusResult = updateNotificationStatus(
291
+ response.notification_status,
292
+ this.currentState.notification_status,
293
+ );
294
+
295
+ if (
296
+ result.changed ||
297
+ aggregatedActivitiesResult.changed ||
298
+ notificationStatusResult.changed
299
+ ) {
283
300
  this.state.partialNext({
284
301
  activities: result.activities,
302
+ aggregated_activities:
303
+ aggregatedActivitiesResult.aggregated_activities,
304
+ notification_status: notificationStatusResult.notification_status,
285
305
  next: response.next,
286
306
  prev: response.prev,
287
307
  });