Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit e53c161

Browse files
committedSep 29, 2022
fix: address selector showing invlid identicon when address is empty
1 parent 58835f2 commit e53c161

File tree

2 files changed

+21
-21
lines changed

2 files changed

+21
-21
lines changed
 

‎src/components/MewAddressSelect/MewAddressSelect.vue

+17-10
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
<!-- ===================================================================================== -->
3333
<template #prepend-inner>
3434
<div
35-
v-if="!isValidAddress"
35+
v-if="!isValidAddress || !blockieHash"
3636
class="blockie-placeholder mr-1 selectHover"
3737
/>
3838
<mew-blockie
@@ -87,9 +87,7 @@
8787
class="dropdown-icon-container d-flex align-center justify-center cursor-pointer full-height"
8888
@click="toggle"
8989
>
90-
<v-icon class="mew-heading-1 mx-5">
91-
mdi-chevron-down
92-
</v-icon>
90+
<v-icon class="mew-heading-1 mx-5"> mdi-chevron-down </v-icon>
9391
</div>
9492
</template>
9593

@@ -115,10 +113,7 @@
115113
v-if="!item.resolvedAddr || item.resolvedAddr === ''"
116114
:hash="item.address"
117115
/>
118-
<span
119-
v-else
120-
class="mew-address"
121-
>{{ item.address }}</span>
116+
<span v-else class="mew-address">{{ item.address }}</span>
122117
</div>
123118
<div class="overline primary--text font-weight-medium ml-3">
124119
{{ item.nickname }}
@@ -255,6 +250,13 @@ export default {
255250
errorMessages: {
256251
type: [String, Array],
257252
default: ''
253+
},
254+
/**
255+
* Clear address
256+
*/
257+
clearAddress: {
258+
type: Boolean,
259+
default: false
258260
}
259261
},
260262
data() {
@@ -287,10 +289,15 @@ export default {
287289
: this.addressValue.address || this.addressValue;
288290
}
289291
},
292+
watch: {
293+
clearAddress() {
294+
this.clear();
295+
}
296+
},
290297
methods: {
291298
/**
292-
* Clears the v-model value.
293-
*/
299+
* Clears the v-model value.
300+
*/
294301
clear() {
295302
this.addressValue = '';
296303
},

‎src/components/MewBlockie/MewBlockie.vue

+4-11
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<template>
22
<div>
33
<div
4+
v-show="address"
45
style="position: relative"
56
:style="`width: ${width}; height: ${height}`"
67
>
@@ -9,24 +10,16 @@
910
:src="blockieImg"
1011
alt="Blockie Image"
1112
style="display: block; border-radius: 50%"
12-
>
13+
/>
1314

1415
<!--
1516
=====================================================================
1617
Inset shadow on edge of blockie image
1718
=====================================================================
1819
-->
19-
<div
20-
v-if="!flat"
21-
class="inset-shadow"
22-
/>
20+
<div v-if="!flat" class="inset-shadow" />
2321
</div>
24-
<img
25-
v-if="currency"
26-
alt="icon"
27-
class="currency-icon"
28-
:src="currency"
29-
>
22+
<img v-if="currency" alt="icon" class="currency-icon" :src="currency" />
3023
</div>
3124
</template>
3225