mirror of
https://fastgit.cc/github.com/sourcegit-scm/sourcegit
synced 2026-04-23 10:22:13 +08:00
enhance: only log exception in popup task (#1281)
Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
@@ -78,7 +78,7 @@ namespace SourceGit
|
||||
return builder;
|
||||
}
|
||||
|
||||
private static void LogException(Exception ex)
|
||||
public static void LogException(Exception ex)
|
||||
{
|
||||
if (ex == null)
|
||||
return;
|
||||
|
||||
@@ -100,23 +100,32 @@ namespace SourceGit.ViewModels
|
||||
|
||||
public async void ProcessPopup()
|
||||
{
|
||||
if (_popup is { InProgress: false })
|
||||
if (_popup is { InProgress: false } dump)
|
||||
{
|
||||
if (!_popup.Check())
|
||||
if (!dump.Check())
|
||||
return;
|
||||
|
||||
_popup.InProgress = true;
|
||||
var task = _popup.Sure();
|
||||
dump.InProgress = true;
|
||||
var task = dump.Sure();
|
||||
var finished = false;
|
||||
if (task != null)
|
||||
{
|
||||
var finished = await task;
|
||||
_popup.InProgress = false;
|
||||
try
|
||||
{
|
||||
finished = await task;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
App.LogException(e);
|
||||
}
|
||||
|
||||
dump.InProgress = false;
|
||||
if (finished)
|
||||
Popup = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
_popup.InProgress = false;
|
||||
dump.InProgress = false;
|
||||
Popup = null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user