Made everything a bit more consistent.
This commit is contained in:
parent
5737bc6a33
commit
ccf63cd413
@ -111,8 +111,9 @@ const fetchAvatar = (identity: string) => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const loadAvatar = () => {
|
const loadAvatar = (identity: string) => {
|
||||||
fetchAvatar(identity.value).then(() => {
|
// fetches avatar from keybase and stores it in localStorage
|
||||||
|
fetchAvatar(identity).then(() => {
|
||||||
localStorage.setItem('avatars', JSON.stringify(avatars.value));
|
localStorage.setItem('avatars', JSON.stringify(avatars.value));
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@ -122,7 +123,7 @@ onMounted(() => {
|
|||||||
staking.fetchValidator(validator).then((res) => {
|
staking.fetchValidator(validator).then((res) => {
|
||||||
v.value = res.validator;
|
v.value = res.validator;
|
||||||
identity.value = res.validator?.description?.identity || '';
|
identity.value = res.validator?.description?.identity || '';
|
||||||
if (identity.value && !avatars.value[identity.value]) loadAvatar();
|
if (identity.value && !avatars.value[identity.value]) loadAvatar(identity.value);
|
||||||
|
|
||||||
const prefix = valoperToPrefix(v.value.operator_address) || '<Invalid>';
|
const prefix = valoperToPrefix(v.value.operator_address) || '<Invalid>';
|
||||||
addresses.value.hex = consensusPubkeyToHexAddress(
|
addresses.value.hex = consensusPubkeyToHexAddress(
|
||||||
@ -208,7 +209,7 @@ function pageload(p: number) {
|
|||||||
class="object-contain"
|
class="object-contain"
|
||||||
@error="
|
@error="
|
||||||
(e) => {
|
(e) => {
|
||||||
loadAvatar();
|
loadAvatar(identity);
|
||||||
}
|
}
|
||||||
"
|
"
|
||||||
/>
|
/>
|
||||||
|
@ -164,17 +164,15 @@ const fetchAvatar = (identity: string) => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const loadAvatar = (validator: Validator) => {
|
const loadAvatar = (identity: string) => {
|
||||||
const identity = validator.description?.identity;
|
// fetches avatar from keybase and stores it in localStorage
|
||||||
|
|
||||||
if (identity) {
|
|
||||||
fetchAvatar(identity).then(() => {
|
fetchAvatar(identity).then(() => {
|
||||||
localStorage.setItem('avatars', JSON.stringify(avatars.value));
|
localStorage.setItem('avatars', JSON.stringify(avatars.value));
|
||||||
});
|
});
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const loadAvatars = () => {
|
const loadAvatars = () => {
|
||||||
|
// fetches all avatars from keybase and stores it in localStorage
|
||||||
const promises = staking.validators.map((validator) => {
|
const promises = staking.validators.map((validator) => {
|
||||||
const identity = validator.description?.identity;
|
const identity = validator.description?.identity;
|
||||||
|
|
||||||
@ -340,7 +338,8 @@ loadAvatars();
|
|||||||
class="object-contain"
|
class="object-contain"
|
||||||
@error="
|
@error="
|
||||||
(e) => {
|
(e) => {
|
||||||
loadAvatar(v);
|
const identity = v.description?.identity;
|
||||||
|
if (identity) loadAvatar(identity);
|
||||||
}
|
}
|
||||||
"
|
"
|
||||||
/>
|
/>
|
||||||
|
Loading…
Reference in New Issue
Block a user