diff --git a/src/main/ts/wallet/MoneroWallet.ts b/src/main/ts/wallet/MoneroWallet.ts index 61f220da1..bd316283f 100644 --- a/src/main/ts/wallet/MoneroWallet.ts +++ b/src/main/ts/wallet/MoneroWallet.ts @@ -69,6 +69,7 @@ export default class MoneroWallet { protected connectionManager: MoneroConnectionManager; protected connectionManagerListener: MoneroConnectionManagerListener; protected listeners: MoneroWalletListener[] = []; + protected _isClosed = false; /** * Hidden constructor. @@ -1382,6 +1383,7 @@ export default class MoneroWallet { this.connectionManager = undefined; this.connectionManagerListener = undefined; this.listeners.splice(0, this.listeners.length); + this._isClosed = true; } /** @@ -1390,7 +1392,7 @@ export default class MoneroWallet { * @return {Promise} true if the wallet is closed, false otherwise */ async isClosed(): Promise { - throw new MoneroError("Not supported"); + return this._isClosed; } // -------------------------------- PRIVATE --------------------------------- diff --git a/src/main/ts/wallet/MoneroWalletKeys.ts b/src/main/ts/wallet/MoneroWalletKeys.ts index b0a07bae1..534971b07 100644 --- a/src/main/ts/wallet/MoneroWalletKeys.ts +++ b/src/main/ts/wallet/MoneroWalletKeys.ts @@ -20,7 +20,6 @@ export class MoneroWalletKeys extends MoneroWallet { protected cppAddress: string; protected module: any; protected walletProxy: MoneroWalletKeysProxy; - protected _isClosed: boolean; // --------------------------- STATIC UTILITIES ----------------------------- @@ -169,7 +168,6 @@ export class MoneroWalletKeys extends MoneroWallet { */ constructor(cppAddress, walletProxy?: MoneroWalletKeysProxy) { super(); - this._isClosed = false; if (!cppAddress && !walletProxy) throw new MoneroError("Must provide cppAddress or walletProxy"); if (walletProxy) this.walletProxy = walletProxy; else {