Add optional argument promptName to
prepareAndSendPairingTx
This commit is contained in:
parent
ed0c11b527
commit
afe45ad960
@ -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.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user