Skip to content

Commit

Permalink
refactor: code style (#10400)
Browse files Browse the repository at this point in the history
  • Loading branch information
guanbinrui committed Aug 15, 2023
1 parent 1710f6d commit 23956d9
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions packages/mask/src/utils/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,17 @@ export async function attachNextIDToProfile(nextID: ProfileInformationFromNextID

if (!nextID?.fromNextID || !nextID.linkedPersona || !whoAmI) return
const [rpc, emit] = batch(notify(Services.Identity))
nextID.linkedTwitterNames?.forEach((x) => {
const newItem = {
...nextID,
nickname: x,
identifier: ProfileIdentifier.of('twitter.com', x).expect(`${x} should be a valid user id`),
}
rpc.attachNextIDPersonaToProfile(newItem, whoAmI)
})
await Promise.allSettled(
nextID.linkedTwitterNames?.map((x) => {
return rpc.attachNextIDPersonaToProfile(
{
...nextID,
nickname: x,
identifier: ProfileIdentifier.of('twitter.com', x).expect(`${x} should be a valid user id`),
},
whoAmI,
)
}) ?? [],
)
emit()
}

0 comments on commit 23956d9

Please sign in to comment.