diff --git a/CHANGELOG.md b/CHANGELOG.md index 42f969400..4492d0a33 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -# v1.1.183 +# Upcoming ### Client * Feature: Auto Configure Windows Defender Firewall * Update: Improve diagnosing diff --git a/Pub/Version.json b/Pub/Version.json index 2628f7207..e84e9ea48 100644 Binary files a/Pub/Version.json and b/Pub/Version.json differ diff --git a/VpnHood.Client.App.Android/Assets/SPA.zip b/VpnHood.Client.App.Android/Assets/SPA.zip index fb35c409c..a8ce7df42 100644 Binary files a/VpnHood.Client.App.Android/Assets/SPA.zip and b/VpnHood.Client.App.Android/Assets/SPA.zip differ diff --git a/VpnHood.Client.App.UI.Html/package.json b/VpnHood.Client.App.UI.Html/package.json index 946a8c5a7..a3976b139 100644 --- a/VpnHood.Client.App.UI.Html/package.json +++ b/VpnHood.Client.App.UI.Html/package.json @@ -1,6 +1,6 @@ { "name": "vpnhood-spa", - "version": "1.0.73", + "version": "1.0.74", "private": true, "scripts": { "serve": "vue-cli-service serve", diff --git a/VpnHood.Client.App.UI.Html/src/components/ErrorSheet.vue b/VpnHood.Client.App.UI.Html/src/components/ErrorSheet.vue index 7785ad576..b3854fbaf 100644 --- a/VpnHood.Client.App.UI.Html/src/components/ErrorSheet.vue +++ b/VpnHood.Client.App.UI.Html/src/components/ErrorSheet.vue @@ -74,7 +74,7 @@ export default { methods: { diagnose() { window.gtag('event', 'diagnose'); - this.store.state.isDiagnosedStarted = true; + this.store.state.hasDiagnosedStarted = true; const clientProfileId = this.store.state.lastActiveClientProfileId; this.store.state.activeClientProfileId = clientProfileId; this.store.invoke("diagnose", { clientProfileId }); diff --git a/VpnHood.Client.App.UI.Html/src/pages/Home.vue b/VpnHood.Client.App.UI.Html/src/pages/Home.vue index dbf68bba2..f2e12e008 100644 --- a/VpnHood.Client.App.UI.Html/src/pages/Home.vue +++ b/VpnHood.Client.App.UI.Html/src/pages/Home.vue @@ -255,21 +255,21 @@ export default { connect(item) { window.gtag('event', 'connect'); - this.store.state.isDiagnosedStarted = false; + this.store.state.hasDiagnosedStarted = false; this.store.state.activeClientProfileId = item.clientProfile.clientProfileId; this.store.invoke("connect", { clientProfileId: item.clientProfile.clientProfileId }); }, diagnose(item) { window.gtag('event', 'diagnose'); - this.store.state.isDiagnosedStarted = true; + this.store.state.hasDiagnosedStarted = true; this.store.state.activeClientProfileId = item.clientProfile.clientProfileId; this.store.invoke("diagnose", { clientProfileId: item.clientProfile.clientProfileId }); }, disconnect() { window.gtag('event', 'disconnect'); - this.store.state.clientState = this.$t("disconnecting"); + this.store.state.connectionState = "Disconnecting"; this.store.invoke("disconnect"); }, diff --git a/VpnHood.Client.App.Win/Resources/SPA.zip b/VpnHood.Client.App.Win/Resources/SPA.zip index fb35c409c..a8ce7df42 100644 Binary files a/VpnHood.Client.App.Win/Resources/SPA.zip and b/VpnHood.Client.App.Win/Resources/SPA.zip differ diff --git a/VpnHood.Client.App/VpnHoodApp.cs b/VpnHood.Client.App/VpnHoodApp.cs index ef69b29b6..48330d322 100644 --- a/VpnHood.Client.App/VpnHoodApp.cs +++ b/VpnHood.Client.App/VpnHoodApp.cs @@ -217,9 +217,13 @@ public async Task Connect(Guid clientProfileId, bool diagnose = false, string us } catch (Exception ex) { - VhLogger.Current?.LogError(ex.Message); - LastException = ex; - Disconnect(); + //user may disconnect before connection closed + if (!_hasDisconnectedByUser) + { + VhLogger.Current?.LogError(ex.Message); + LastException = ex; + Disconnect(); + } throw; } finally @@ -274,11 +278,8 @@ private void PacketCapture_OnStopped(object sender, EventArgs e) public void Disconnect(bool byUser = false) { - if (_client == null) - { - VhLogger.Current = CreateLogger(false); + if (_isDisconnecting) return; - } try { @@ -288,14 +289,17 @@ public void Disconnect(bool byUser = false) _hasDisconnectedByUser = true; // check for any success - if (_client.ReceivedByteCount > 1000) - _hasAnyDataArrived = true; - else if (LastException == null) - LastException = new Exception("No data has been arrived!"); + if (_client != null) + { + if (_client.ReceivedByteCount > 1000) + _hasAnyDataArrived = true; + else if (LastException == null) + LastException = new Exception("No data has been arrived!"); + } // check diagnose if (_hasDiagnoseStarted && LastException == null) - LastException = new Exception("Diagnose has been finished!"); + LastException = new Exception("Diagnose has been finished and no issue has been detected."); ActiveClientProfile = null; @@ -315,6 +319,7 @@ public void Disconnect(bool byUser = false) } finally { + _isConnecting = false; _isDisconnecting = false; } }