Add optional argument promptName to

prepareAndSendPairingTx
This commit is contained in:
NicolasCantu 2025-03-17 17:11:16 +01:00
parent ed0c11b527
commit afe45ad960

View File

@ -173,7 +173,7 @@ async function onCreateButtonClick() {
} }
} }
export async function prepareAndSendPairingTx() { export async function prepareAndSendPairingTx(promptName: boolean = false) {
const service = await Services.getInstance(); const service = await Services.getInstance();
// Device 1 wait Device 2 // Device 1 wait Device 2
@ -186,9 +186,11 @@ export async function prepareAndSendPairingTx() {
} }
// Prompt the user for a username. // Prompt the user for a username.
const userName = prompt("Please enter your user name:"); let userName;
if (!userName) { if (promptName) {
throw new Error("User name is required for the pairing process."); userName = prompt("Please enter your user name:");
} else {
userName = "";
} }
// Create the process after a delay. // Create the process after a delay.