forked from cerc-io/cosmos-explorer
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 = () => {
|
||||
fetchAvatar(identity.value).then(() => {
|
||||
const loadAvatar = (identity: string) => {
|
||||
// fetches avatar from keybase and stores it in localStorage
|
||||
fetchAvatar(identity).then(() => {
|
||||
localStorage.setItem('avatars', JSON.stringify(avatars.value));
|
||||
});
|
||||
};
|
||||
@ -122,7 +123,7 @@ onMounted(() => {
|
||||
staking.fetchValidator(validator).then((res) => {
|
||||
v.value = res.validator;
|
||||
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>';
|
||||
addresses.value.hex = consensusPubkeyToHexAddress(
|
||||
@ -208,7 +209,7 @@ function pageload(p: number) {
|
||||
class="object-contain"
|
||||
@error="
|
||||
(e) => {
|
||||
loadAvatar();
|
||||
loadAvatar(identity);
|
||||
}
|
||||
"
|
||||
/>
|
||||
|
@ -164,17 +164,15 @@ const fetchAvatar = (identity: string) => {
|
||||
});
|
||||
};
|
||||
|
||||
const loadAvatar = (validator: Validator) => {
|
||||
const identity = validator.description?.identity;
|
||||
|
||||
if (identity) {
|
||||
fetchAvatar(identity).then(() => {
|
||||
localStorage.setItem('avatars', JSON.stringify(avatars.value));
|
||||
});
|
||||
}
|
||||
const loadAvatar = (identity: string) => {
|
||||
// fetches avatar from keybase and stores it in localStorage
|
||||
fetchAvatar(identity).then(() => {
|
||||
localStorage.setItem('avatars', JSON.stringify(avatars.value));
|
||||
});
|
||||
};
|
||||
|
||||
const loadAvatars = () => {
|
||||
// fetches all avatars from keybase and stores it in localStorage
|
||||
const promises = staking.validators.map((validator) => {
|
||||
const identity = validator.description?.identity;
|
||||
|
||||
@ -340,7 +338,8 @@ loadAvatars();
|
||||
class="object-contain"
|
||||
@error="
|
||||
(e) => {
|
||||
loadAvatar(v);
|
||||
const identity = v.description?.identity;
|
||||
if (identity) loadAvatar(identity);
|
||||
}
|
||||
"
|
||||
/>
|
||||
|
Loading…
Reference in New Issue
Block a user