Skip to content

Commit

Permalink
fix: judge netwrok before add new identifier
Browse files Browse the repository at this point in the history
  • Loading branch information
guanbinrui committed Nov 27, 2019
1 parent 6c8c3a3 commit 0f5ec4b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/social-network/defaults/FriendsValueRef.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ export function InitFriendsValueRef(self: SocialNetworkUI, network: string) {
})
} else if (event.reason === 'new') {
next = next.filter(x => !x.identifier.equals(event.of.identifier))
next.push(event.of)
if (event.of.identifier.network === network) {
next.push(event.of)
}
} else {
throw new Error('Invalid state')
}
Expand Down

0 comments on commit 0f5ec4b

Please sign in to comment.