From f4a7d437c8beb7716be74c4faaad423e0f1b6a5f Mon Sep 17 00:00:00 2001 From: Jose Olarte III Date: Thu, 31 Jul 2025 20:13:55 +0800 Subject: [PATCH] Fix parameter passing in contact gift dialogs - Replace @Emit decorator with direct $emit calls in ContactListItem - Fix DID comparison from loose to strict equality in nameForDid function - Resolve issue where giver/recipient names showed as "this unnamed user" The @Emit decorator was not properly spreading array parameters, causing the parent component to receive arrays instead of separate string parameters. --- src/components/ContactListItem.vue | 12 ++++++++---- src/libs/util.ts | 4 ++-- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/components/ContactListItem.vue b/src/components/ContactListItem.vue index c972fe80..11229501 100644 --- a/src/components/ContactListItem.vue +++ b/src/components/ContactListItem.vue @@ -121,6 +121,12 @@ import { AppString } from "../constants/app"; components: { EntityIcon, }, + emits: [ + "toggle-selection", + "show-identicon", + "show-gifted-dialog", + "open-offer-dialog", + ], }) export default class ContactListItem extends Vue { @Prop({ required: true }) contact!: Contact; @@ -151,14 +157,12 @@ export default class ContactListItem extends Vue { return contact; } - @Emit("show-gifted-dialog") emitShowGiftedDialog(fromDid: string, toDid: string) { - return { fromDid, toDid }; + this.$emit("show-gifted-dialog", fromDid, toDid); } - @Emit("open-offer-dialog") emitOpenOfferDialog(did: string, name: string | undefined) { - return { did, name }; + this.$emit("open-offer-dialog", did, name); } /** diff --git a/src/libs/util.ts b/src/libs/util.ts index ea234243..3404054d 100644 --- a/src/libs/util.ts +++ b/src/libs/util.ts @@ -191,9 +191,9 @@ export const nameForDid = ( did: string, ): string => { if (did === activeDid) { - return "you"; + return "You"; } - const contact = R.find((con) => con.did == did, contacts); + const contact = R.find((con) => con.did === did, contacts); return nameForContact(contact); };