Generate username color based on hash
This commit is contained in:
+26
-3
@@ -1,11 +1,34 @@
|
||||
import {uniqBy, uniq, now} from "@welshman/lib"
|
||||
import {GROUPS, asDecryptedEvent, getGroupTags, getRelayTagValues, readList, editList, makeList, createList} from "@welshman/util"
|
||||
import {
|
||||
GROUPS,
|
||||
asDecryptedEvent,
|
||||
getGroupTags,
|
||||
getRelayTagValues,
|
||||
readList,
|
||||
editList,
|
||||
makeList,
|
||||
createList,
|
||||
} from "@welshman/util"
|
||||
import {pk, signer, repository, INDEXER_RELAYS} from "@app/base"
|
||||
import {getWriteRelayUrls, loadGroup, loadGroupMembership, loadProfile, loadFollows, loadMutes, loadRelaySelections, publish, ensurePlaintext} from "@app/state"
|
||||
import {
|
||||
getWriteRelayUrls,
|
||||
loadGroup,
|
||||
loadGroupMembership,
|
||||
loadProfile,
|
||||
loadFollows,
|
||||
loadMutes,
|
||||
loadRelaySelections,
|
||||
publish,
|
||||
ensurePlaintext,
|
||||
} from "@app/state"
|
||||
|
||||
export const loadUserData = async (pubkey: string, hints: string[] = []) => {
|
||||
const relaySelections = await loadRelaySelections(pubkey, INDEXER_RELAYS)
|
||||
const relays = uniq([...getRelayTagValues(relaySelections?.tags || []), ...INDEXER_RELAYS, ...hints])
|
||||
const relays = uniq([
|
||||
...getRelayTagValues(relaySelections?.tags || []),
|
||||
...INDEXER_RELAYS,
|
||||
...hints,
|
||||
])
|
||||
const membership = await loadGroupMembership(pubkey, relays)
|
||||
const promises = [
|
||||
loadProfile(pubkey, relays),
|
||||
|
||||
Reference in New Issue
Block a user