Skip to content

Commit 415564b

Browse files
committed
enhance: do not wait for the cancel operation finished (the UI will auto wait for Sure complete)
Signed-off-by: leo <longshuang@msn.cn>
1 parent 36c0e21 commit 415564b

5 files changed

Lines changed: 10 additions & 5 deletions

File tree

src/ViewModels/Clone.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,8 @@ public override async Task<bool> Sure()
189189

190190
public override void Terminate()
191191
{
192-
_cancellation?.Cancel();
192+
// Just fire cancel event and UI will auto wait the `Sure` complete
193+
var _ = _cancellation?.CancelAsync();
193194
}
194195

195196
private void CollectGroups(List<RepositoryNode> outs, List<RepositoryNode> collections)

src/ViewModels/Fetch.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,8 @@ public override async Task<bool> Sure()
124124

125125
public override void Terminate()
126126
{
127-
_cancellation?.Cancel();
127+
// Just fire cancel event and UI will auto wait the `Sure` complete
128+
var _ = _cancellation?.CancelAsync();
128129
}
129130

130131
private readonly Repository _repo = null;

src/ViewModels/Pull.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,8 @@ public override async Task<bool> Sure()
183183

184184
public override void Terminate()
185185
{
186-
_cancellation?.Cancel();
186+
// Just fire cancel event and UI will auto wait the `Sure` complete
187+
var _ = _cancellation?.CancelAsync();
187188
}
188189

189190
private void PostRemoteSelected()

src/ViewModels/Push.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,8 @@ public override async Task<bool> Sure()
226226

227227
public override void Terminate()
228228
{
229-
_cancellation?.Cancel();
229+
// Just fire cancel event and UI will auto wait the `Sure` complete
230+
var _ = _cancellation?.CancelAsync();
230231
}
231232

232233
private void AutoSelectBranchByRemote()

src/ViewModels/PushRevision.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ public override async Task<bool> Sure()
6161

6262
public override void Terminate()
6363
{
64-
_cancellation?.Cancel();
64+
// Just fire cancel event and UI will auto wait the `Sure` complete
65+
var _ = _cancellation?.CancelAsync();
6566
}
6667

6768
private readonly Repository _repo;

0 commit comments

Comments
 (0)