Take a username at pairing
This commit is contained in:
parent
7ad8063e87
commit
1747908d20
@ -169,10 +169,25 @@ export async function prepareAndSendPairingTx(secondDeviceAddress: string) {
|
||||
} catch (e) {
|
||||
throw e;
|
||||
}
|
||||
// Create the process
|
||||
|
||||
// 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.");
|
||||
}
|
||||
|
||||
// Create the process after a delay.
|
||||
setTimeout(async () => {
|
||||
const relayAddress = service.getAllRelays();
|
||||
const createPairingProcessReturn = await service.createPairingProcess([secondDeviceAddress], relayAddress[0].spAddress, 1);
|
||||
const relayAddress = service.getAllRelays();
|
||||
|
||||
// Pass the userName as an additional parameter.
|
||||
const createPairingProcessReturn = await service.createPairingProcess(
|
||||
userName,
|
||||
[secondDeviceAddress],
|
||||
relayAddress[0].spAddress,
|
||||
1,
|
||||
userName
|
||||
);
|
||||
|
||||
if (!createPairingProcessReturn.updated_process) {
|
||||
throw new Error('createPairingProcess returned an empty new process'); // This should never happen
|
||||
|
Loading…
x
Reference in New Issue
Block a user