From b7d533600bc8e1b48c001be7c6b9498fc57fdd3c Mon Sep 17 00:00:00 2001 From: Nicolas Vargas Date: Thu, 3 Oct 2024 14:20:22 -0300 Subject: [PATCH] fix: event signature generation logic --- src/components/EventCall.vue | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/components/EventCall.vue b/src/components/EventCall.vue index 8e845ace..7c30a918 100644 --- a/src/components/EventCall.vue +++ b/src/components/EventCall.vue @@ -39,12 +39,20 @@ export default { return this.data.inputs }, eventSignature () { - const { name, inputs } = this + const { name, inputs, space, indexed } = this const eventName = `${name}` const eventParams = inputs.map(input => { - const inputDetails = `${input.type} ${input.name}` - return input.indexed ? `${inputDetails} indexed` : inputDetails + const inputType = input.type + const inputName = input.name + + let formattedInputLine + if (input.indexed) { + formattedInputLine = `${inputType}${space}${indexed}${space}${inputName}` + } else { + formattedInputLine = `${inputType}${space}${inputName}` + } + return formattedInputLine }) return `${eventName} (${eventParams.join(', ').trim()})`