mirror of
https://github.com/Permissionless-Software-Foundation/bch-dex-taker-v2.git
synced 2026-09-21 16:52:01 -07:00
Merge pull request #48 from Permissionless-Software-Foundation/ct-unstable
fix(feeds): Removing duplicate posts
This commit is contained in:
@@ -1,5 +1,16 @@
|
|||||||
/*
|
/*
|
||||||
Component for reading the nostr feeds.
|
Component for reading the nostr feeds.
|
||||||
|
|
||||||
|
TODO:
|
||||||
|
- fetchProfile() should retrieve a profile from multiple relays. If the first relay returns a profile,
|
||||||
|
then that profile can be used and promise resolved. If the first relay returns no profile, the next
|
||||||
|
one should be tried until all relays are exhausted or one returns a profile.
|
||||||
|
|
||||||
|
- useEffect() retrieves the feeds. This should cycle through each relay and posts from each one.
|
||||||
|
Once each relays has been tried, the posts should remove duplicate entries. Finally posts should
|
||||||
|
be sorted by date.
|
||||||
|
|
||||||
|
- Clicking on a profile picture, name, or npub should open the profile for that user in a new tab.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Global npm libraries
|
// Global npm libraries
|
||||||
@@ -37,7 +48,8 @@ function Feeds (props) {
|
|||||||
})
|
})
|
||||||
if (hasProfileRequest) return
|
if (hasProfileRequest) return
|
||||||
|
|
||||||
const pool = RelayPool(config.nostrRelays)
|
// const pool = RelayPool(config.nostrRelays)
|
||||||
|
const pool = RelayPool([config.nostrRelay])
|
||||||
pool.on('open', relay => {
|
pool.on('open', relay => {
|
||||||
relay.subscribe('subid', { limit: 5, kinds: [0], authors: [pubkey] })
|
relay.subscribe('subid', { limit: 5, kinds: [0], authors: [pubkey] })
|
||||||
})
|
})
|
||||||
@@ -78,7 +90,8 @@ function Feeds (props) {
|
|||||||
// Get global feed posts
|
// Get global feed posts
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const start = () => {
|
const start = () => {
|
||||||
const pool = RelayPool(config.nostrRelays)
|
// const pool = RelayPool(config.nostrRelays)
|
||||||
|
const pool = RelayPool([config.nostrRelay])
|
||||||
pool.on('open', relay => {
|
pool.on('open', relay => {
|
||||||
relay.subscribe('REQ', { limit: 10, kinds: [1], '#t': ['slpdex-socialmedia'] })
|
relay.subscribe('REQ', { limit: 10, kinds: [1], '#t': ['slpdex-socialmedia'] })
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user