From a3b98944994223b53176e444aa52c88a3cb35208 Mon Sep 17 00:00:00 2001 From: Victor Creed Date: Thu, 10 Dec 2020 12:29:09 +0200 Subject: [PATCH] fixes wallet disconnection --- src/utils/sovryn/sovryn-network.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/utils/sovryn/sovryn-network.ts b/src/utils/sovryn/sovryn-network.ts index 25b6b81d4..0a8d4b576 100644 --- a/src/utils/sovryn/sovryn-network.ts +++ b/src/utils/sovryn/sovryn-network.ts @@ -94,6 +94,7 @@ export class SovrynNetwork { } catch (e) { console.error('connect fails.'); console.error(e); + this.disconnect(); return false; } } @@ -105,6 +106,7 @@ export class SovrynNetwork { } catch (e) { console.error('connectTo fails.'); console.error(e); + this.disconnect(); return false; } } @@ -294,7 +296,7 @@ export class SovrynNetwork { try { if (provider.on) { provider.on('close', () => { - this.store().dispatch(actions.disconnect()); + this.disconnect(); }); provider.on('error', error => { console.error('provider error', error); @@ -349,7 +351,7 @@ export class SovrynNetwork { } catch (e) { console.error('connect provider fails.'); console.error(e); - this.store().dispatch(actions.disconnect()); + this.disconnect(); } }