File tree Expand file tree Collapse file tree 3 files changed +7
-16
lines changed
packages/feeds-client/src
feed/event-handlers/follow Expand file tree Collapse file tree 3 files changed +7
-16
lines changed Original file line number Diff line number Diff line change @@ -6,13 +6,10 @@ import type {
66 UpdateStateResult ,
77} from '../../../types-internal' ;
88
9- import { isFeedResponse } from '../../../utils' ;
109import { getStateUpdateQueueId , shouldUpdateState } from '../../../utils' ;
1110
1211export const updateStateFollowDeleted = (
13- follow :
14- | FollowResponse
15- | { source_feed : { fid : string } ; target_feed : { fid : string } } ,
12+ follow : FollowResponse ,
1613 currentState : FeedState ,
1714 currentFeedId : string ,
1815 connectedUserId ?: string ,
@@ -46,7 +43,6 @@ export const updateStateFollowDeleted = (
4643 } ;
4744
4845 if (
49- isFeedResponse ( source ) &&
5046 source . created_by . id === connectedUserId &&
5147 currentState . own_follows !== undefined
5248 ) {
@@ -68,11 +64,10 @@ export const updateStateFollowDeleted = (
6864
6965export function handleFollowDeleted (
7066 this : Feed ,
71- eventOrResponse :
72- | PartializeAllBut < EventPayload < 'feeds.follow.deleted' > , 'follow' >
73- | {
74- follow : { source_feed : { fid : string } ; target_feed : { fid : string } } ;
75- } ,
67+ eventOrResponse : PartializeAllBut <
68+ EventPayload < 'feeds.follow.deleted' > ,
69+ 'follow'
70+ > ,
7671) {
7772 const follow = eventOrResponse . follow ;
7873
Original file line number Diff line number Diff line change @@ -419,7 +419,7 @@ export class FeedsClient extends FeedsApi {
419419 [ request . source , request . target ] . forEach ( ( fid ) => {
420420 const feed = this . activeFeeds [ fid ] ;
421421 if ( feed ) {
422- handleFollowDeleted . bind ( this ) ( response . follow ) ;
422+ handleFollowDeleted . bind ( feed ) ( response ) ;
423423 }
424424 } ) ;
425425
Original file line number Diff line number Diff line change 1- import { CommentResponse , FeedResponse , FollowResponse } from '../gen/models' ;
1+ import { CommentResponse , FollowResponse } from '../gen/models' ;
22import { StreamFile } from '../types' ;
33import { CommentParent } from '../types' ;
44
55export const isFollowResponse = ( data : object ) : data is FollowResponse => {
66 return 'source_feed' in data && 'target_feed' in data ;
77} ;
88
9- export const isFeedResponse = ( data : object ) : data is FeedResponse => {
10- return 'created_by' in data ;
11- } ;
12-
139export const isCommentResponse = (
1410 entity : CommentParent ,
1511) : entity is CommentResponse => {
You can’t perform that action at this time.
0 commit comments