Generate username color based on hash

This commit is contained in:
Jon Staab
2024-08-16 15:17:30 -07:00
parent 0eb65be427
commit 297e69af21
19 changed files with 329 additions and 73 deletions
+26 -3
View File
@@ -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),