Skip to content

Commit

Permalink
#1851 - Fix the broken VoterAvatars.vue component (#1852)
Browse files Browse the repository at this point in the history
* add a fix for Prompt.vue not being closed properly

* fix the broken VoterAvatars.vue
  • Loading branch information
SebinSong authored and corrideat committed Mar 4, 2024
1 parent 58d0915 commit 42ddb0b
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 12 deletions.
6 changes: 3 additions & 3 deletions frontend/model/contracts/manifests.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"manifests": {
"gi.contracts/chatroom": "z9brRu3VMifmYkk97FijV5myjFAC5xPTYr2itAA5R8B5ygam3WZe",
"gi.contracts/group": "z9brRu3VG462ZBcaa6yEmybw3aZztTfbanPuc6Dk5c7pNL8nBmYH",
"gi.contracts/identity": "z9brRu3VVFhuow21YeqtEreuVwurDzwV65QSuD39QqRE5MZoqADs"
"gi.contracts/chatroom": "z9brRu3VXcbQ8j8sZKgGtmBWrmhRPWYyYPCAjrwUFvteX93Hn8MV",
"gi.contracts/group": "z9brRu3VFeizdYVsxnbF4NfhqNedjVbrhNgd3Mzu9frebx1erEXB",
"gi.contracts/identity": "z9brRu3VU9rsSSW22TcEUGV3yKi9zXCfDcMGfGefgie2yUDszkpb"
}
}
4 changes: 2 additions & 2 deletions frontend/views/components/modal/Prompt.vue
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ export default ({
methods: {
closeModal () {
sbp('okTurtles.events/emit', MODAL_RESPONSE, false)
this.$refs.modal.close()
this.$refs.modal.unload()
},
submit () {
sbp('okTurtles.events/emit', MODAL_RESPONSE, true)
this.$refs.modal.close()
this.$refs.modal.unload()
}
}
}: Object)
Expand Down
5 changes: 4 additions & 1 deletion frontend/views/containers/chatroom/SendArea.vue
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,10 @@ export default ({
const userArr = this.ephemeral.typingUsers
if (userArr.length) {
const getDisplayName = (memberID) => (this.globalProfile(memberID).displayName || this.globalProfile(memberID).username || memberID)
const getDisplayName = (memberID) => {
const profile = this.globalProfile(memberID)
return profile?.displayName || profile?.username || memberID
}
const isMultiple = userArr.length > 1
const usernameCombined = userArr.map(u => getDisplayName(u)).join(', ')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

.c-voters
.c-voter-avatars-item(v-for='entry in list.voters' :key='entry.id')
voter-avatars(:voters='entry.members' :optionName='entry.optionName')
voter-avatars(:voters='entry.users' :optionName='entry.optionName')
</template>

<script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
modal-close.c-tooltip-close-btn(@close='closeTooltip')

ul.c-voters-list
li.c-voter-item(v-for='(votername, index) in voters' :key='votername + index')
avatar-user.c-voter-item-avatar(:contractID='votername' size='xs')
span.c-voter-item-name {{ getDisplayName(votername) }}
li.c-voter-item(v-for='(voterContractID, index) in voters' :key='voterContractID + index')
avatar-user.c-voter-item-avatar(:contractID='voterContractID' size='xs')
span.c-voter-item-name {{ getDisplayName(voterContractID) }}
</template>

<script>
Expand Down Expand Up @@ -77,8 +77,9 @@ export default ({
closeTooltip () {
this.ephemeral.isTooltipActive = false
},
getDisplayName (username) {
return this.globalProfile(username).displayName || username
getDisplayName (contractID) {
const profile = this.globalProfile(contractID)
return profile.displayName || profile.username
}
}
}: Object)
Expand Down

0 comments on commit 42ddb0b

Please sign in to comment.