From afe45ad960c6f46977ef71b38449f61e89e33f96 Mon Sep 17 00:00:00 2001 From: NicolasCantu Date: Mon, 17 Mar 2025 17:11:16 +0100 Subject: [PATCH] Add optional argument promptName to prepareAndSendPairingTx --- src/utils/sp-address.utils.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/utils/sp-address.utils.ts b/src/utils/sp-address.utils.ts index e6d02ed..a659ea7 100755 --- a/src/utils/sp-address.utils.ts +++ b/src/utils/sp-address.utils.ts @@ -173,7 +173,7 @@ async function onCreateButtonClick() { } } -export async function prepareAndSendPairingTx() { +export async function prepareAndSendPairingTx(promptName: boolean = false) { const service = await Services.getInstance(); // Device 1 wait Device 2 @@ -186,9 +186,11 @@ export async function prepareAndSendPairingTx() { } // Prompt the user for a username. - const userName = prompt("Please enter your user name:"); - if (!userName) { - throw new Error("User name is required for the pairing process."); + let userName; + if (promptName) { + userName = prompt("Please enter your user name:"); + } else { + userName = ""; } // Create the process after a delay.