mirror of
https://github.com/XRPLF/xrpl-dev-portal.git
synced 2025-11-23 21:25:49 +00:00
improve client disconnect
This commit is contained in:
@@ -32,8 +32,9 @@ async function getAccount() {
|
|||||||
}
|
}
|
||||||
finally {
|
finally {
|
||||||
// Disconnect from the client
|
// Disconnect from the client
|
||||||
await client.disconnect();
|
if (client && client.isConnected()) {
|
||||||
}
|
await client.disconnect();
|
||||||
|
} }
|
||||||
} // End of getAccount()
|
} // End of getAccount()
|
||||||
|
|
||||||
async function getNewAccount1() {
|
async function getNewAccount1() {
|
||||||
@@ -78,8 +79,9 @@ async function getAccountFromSeed(my_seed) {
|
|||||||
}
|
}
|
||||||
finally {
|
finally {
|
||||||
// Disconnect from the client
|
// Disconnect from the client
|
||||||
await client.disconnect();
|
if (client && client.isConnected()) {
|
||||||
}
|
await client.disconnect();
|
||||||
|
} }
|
||||||
} // End of getAccountFromSeed()
|
} // End of getAccountFromSeed()
|
||||||
|
|
||||||
// *****************************************************
|
// *****************************************************
|
||||||
@@ -169,8 +171,9 @@ async function getXrpBalance() {
|
|||||||
}
|
}
|
||||||
finally {
|
finally {
|
||||||
// Disconnect from the client
|
// Disconnect from the client
|
||||||
await client.disconnect();
|
if (client && client.isConnected()) {
|
||||||
}
|
await client.disconnect();
|
||||||
|
} }
|
||||||
} // End of getXrpBalance()
|
} // End of getXrpBalance()
|
||||||
|
|
||||||
// *******************************************************
|
// *******************************************************
|
||||||
@@ -202,7 +205,8 @@ async function getTokenBalance() {
|
|||||||
}
|
}
|
||||||
finally {
|
finally {
|
||||||
// Disconnect from the client
|
// Disconnect from the client
|
||||||
await client.disconnect();
|
if (client && client.isConnected()) {
|
||||||
}
|
await client.disconnect();
|
||||||
|
} }
|
||||||
} // End of getTokenBalance()
|
} // End of getTokenBalance()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user