Skip to content
This repository has been archived by the owner on Jan 27, 2025. It is now read-only.

Commit

Permalink
refactor: remove the reference to showAvatar data in the SelectInner …
Browse files Browse the repository at this point in the history
…component

in the tests here, it seems this variable is not necessary since we have the isAvatarVisible
also, there was an watcher that set the isAvatarVisible value to the showAvatar
  • Loading branch information
emanuelgsouza committed Jan 10, 2024
1 parent 41c85a2 commit 0cb28b2
Showing 1 changed file with 2 additions and 25 deletions.
27 changes: 2 additions & 25 deletions src/components/Select/components/SelectInner.vue
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
/>
</div>

<div v-if="isAvatarVisible && showAvatar" class="sb-select-inner__avatar">
<div v-if="isAvatarVisible" class="sb-select-inner__avatar">
<SbAvatar
:src="avatarData.src"
size="small"
Expand Down Expand Up @@ -240,10 +240,6 @@ export default {
'remove-item-value',
],
data: () => ({
showAvatar: false,
}),
computed: {
dataTestid() {
return this.$attrs['data-testid'] || 'sb-select-inner'
Expand Down Expand Up @@ -318,8 +314,7 @@ export default {
this.hasValue &&
!this.multiple &&
!this.searchInputText.length &&
!this.isAvatarVisible &&
!this.showAvatar
!this.isAvatarVisible
)
},
Expand Down Expand Up @@ -430,16 +425,6 @@ export default {
},
watch: {
searchInputText(val) {
if (
this.avatarData &&
val === this.avatarData?.label &&
this.isAvatarVisible
) {
this.showAvatar = true
}
},
modelValue(val, oldVal) {
const isSameValue = JSON.stringify(val) === JSON.stringify(oldVal)
if (this.isSearchTextVisible && !isSameValue) {
Expand All @@ -448,14 +433,6 @@ export default {
}
return
}
if (this.isAvatarVisible) {
this.showAvatar = true
}
},
isAvatarVisible(val) {
this.showAvatar = val
},
},
Expand Down

0 comments on commit 0cb28b2

Please sign in to comment.