Skip to content

Commit

Permalink
Diagnose set Last error to "Diagnose has been finshed" if there is no…
Browse files Browse the repository at this point in the history
…t other error
  • Loading branch information
trudyhood committed Dec 20, 2020
1 parent cb77490 commit 11d9d3d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
4 changes: 2 additions & 2 deletions VpnHood.Client.App.UI.Html/src/pages/Home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
:loading="
clientProfileItem_state(item) == 'Connecting' ||
clientProfileItem_state(item) == 'Disconnecting'
? store.state.isDiagnoseStarted
? store.state.hasDiagnoseStarted
? 'warning'
: true
: false
Expand Down Expand Up @@ -91,7 +91,7 @@
</v-list-item>

<!-- Diagnose -->
<v-list-item link @click="diagnose(item)">
<v-list-item link @click="diagnose(item)" :disabled="store.state.hasDiagnoseStarted">
<v-list-item-title>{{
$t("diagnose")
}}</v-list-item-title>
Expand Down
9 changes: 9 additions & 0 deletions VpnHood.Client.App/VpnHoodApp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,11 @@ public async Task Connect(Guid clientProfileId, bool diagnose = false, string us
{
try
{
// disconnect if user request diagnosing
if (diagnose && !_hasDiagnoseStarted && !IsIdle)
Disconnect(true);

// check already in progress
if (ActiveClientProfile != null || !IsIdle)
throw new InvalidOperationException("Connection is already in progress!");

Expand Down Expand Up @@ -277,6 +282,10 @@ public void Disconnect(bool byUser = false)
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!");

ActiveClientProfile = null;

// close client
Expand Down

0 comments on commit 11d9d3d

Please sign in to comment.