mirror of
https://github.com/Permissionless-Software-Foundation/bch-dex-taker-v2.git
synced 2026-09-21 16:52:01 -07:00
Adding comments
This commit is contained in:
@@ -2,6 +2,12 @@
|
|||||||
This component is used to display the list of content creators.
|
This component is used to display the list of content creators.
|
||||||
|
|
||||||
TODO:
|
TODO:
|
||||||
|
- getFollowList() should aggregate all the followers from all the relays.
|
||||||
|
Currently each relay overwrites the last one.
|
||||||
|
|
||||||
|
- loadProfile() should use multiple relays. It should exit after the first
|
||||||
|
successful retrieval of data from a relay. If the relay fails to give data,
|
||||||
|
it should move on to the next relay.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React, { useState, useEffect, useCallback } from 'react'
|
import React, { useState, useEffect, useCallback } from 'react'
|
||||||
@@ -25,7 +31,8 @@ function ContentCreators (props) {
|
|||||||
|
|
||||||
const [followList, setFollowList] = useState([])
|
const [followList, setFollowList] = useState([])
|
||||||
|
|
||||||
// Get the list of profiles followed by the user
|
// Get the list of profiles followed by the user.
|
||||||
|
// It aggregates all the followers from all the relays.
|
||||||
const getFollowList = useCallback(async () => {
|
const getFollowList = useCallback(async () => {
|
||||||
const list = await new Promise((resolve, reject) => {
|
const list = await new Promise((resolve, reject) => {
|
||||||
let list = []
|
let list = []
|
||||||
@@ -59,6 +66,8 @@ function ContentCreators (props) {
|
|||||||
}, [appData])
|
}, [appData])
|
||||||
|
|
||||||
// Load profile from nostr relays
|
// Load profile from nostr relays
|
||||||
|
// It uses multiple relays. It will exit after the first successful retrieval
|
||||||
|
// from any relay. If one relay fails, it will move on to the next one.
|
||||||
const loadProfile = useCallback(async (pubKey) => {
|
const loadProfile = useCallback(async (pubKey) => {
|
||||||
// Looking for the profile in each relay sequentially
|
// Looking for the profile in each relay sequentially
|
||||||
for (let i = 0; i < config.nostrRelays.length; i++) {
|
for (let i = 0; i < config.nostrRelays.length; i++) {
|
||||||
|
|||||||
Reference in New Issue
Block a user