ts: Make account unsubscribe async (#707)

This commit is contained in:
xjcaa 2021-09-12 02:18:16 +10:00 committed by GitHub
parent d73dca15a6
commit 8af34c4d08
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -206,14 +206,14 @@ export class AccountClient {
/**
* Unsubscribes from the account at the given address.
*/
unsubscribe(address: Address) {
async unsubscribe(address: Address) {
let sub = subscriptions.get(address.toString());
if (!sub) {
console.warn("Address is not subscribed");
return;
}
if (subscriptions) {
this._provider.connection
await this._provider.connection
.removeAccountChangeListener(sub.listener)
.then(() => {
subscriptions.delete(address.toString());