Change getNetwork to omit direct follows

This commit is contained in:
Jonathan Staab 2023-03-07 19:49:20 -06:00
parent b2f74b7fcd
commit 770ed5b286
2 changed files with 10 additions and 3 deletions

View File

@ -1,6 +1,13 @@
# Current
- [ ] Collapse relaycard and relaycardsimple?
- [ ] Onboarding
- [ ] Create my own version of nostr.how and extension explanation
- [ ] Move extension suggestion to later in the app, maybe a notification if they don't have one installed
- [ ] Reassure user that if they don't copy the key now they can get it later in settings
- [ ] Design empty state for messages
- [ ] Add copy to explain that chat is public, dms are encrypted
- [ ] Add QR code that pre-fills follows and relays for a new user
- [ ] Review sampleRelays, seems like we shouldn't be shuffling
- [ ] Go over onboarding process, suggest some good relays for newcomers

View File

@ -1,4 +1,4 @@
import {uniq} from 'ramda'
import {uniq, without} from 'ramda'
import {Tags} from 'src/util/nostr'
import database from 'src/agent/database'
import user from 'src/agent/user'
@ -9,7 +9,7 @@ export const getFollows = pubkey =>
export const getNetwork = pubkey => {
const follows = getFollows(pubkey)
return uniq(follows.concat(follows.flatMap(getFollows)))
return uniq(without(follows, follows.flatMap(getFollows)))
}
export const getUserFollows = (): Array<string> =>
@ -18,5 +18,5 @@ export const getUserFollows = (): Array<string> =>
export const getUserNetwork = () => {
const follows = getUserFollows()
return uniq(follows.concat(follows.flatMap(getFollows)))
return uniq(without(follows, follows.flatMap(getFollows)))
}