mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-11-21 22:30:41 +08:00
Reduce calls to IDX profile streams
Check first for a ENS profile and in case it returns null, go for the IDX profile. Signed-off-by: Sebastian Martinez <sebastinez@me.com>
This commit is contained in:
+4
-7
@@ -100,13 +100,10 @@ export class Profile {
|
||||
}
|
||||
|
||||
try {
|
||||
const [ens, idx] = await Promise.allSettled([
|
||||
resolveEnsProfile(address, profileType, config),
|
||||
resolveIdxProfile(formatCAIP10Address(address, "eip155", config.network.chainId), config)
|
||||
]);
|
||||
|
||||
if (ens.status == "fulfilled") profile.ens = ens.value;
|
||||
if (idx.status == "fulfilled") profile.idx = idx.value;
|
||||
profile.ens = await resolveEnsProfile(address, profileType, config);
|
||||
if (!profile.ens) {
|
||||
profile.idx = await resolveIdxProfile(formatCAIP10Address(address, "eip155", config.network.chainId), config);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user