Skip to content

Commit

Permalink
fix: 控制台刷屏
Browse files Browse the repository at this point in the history
fix: Lite版在尝试删除运行中的服务器时崩溃
  • Loading branch information
Zaitonn committed Dec 29, 2024
1 parent 64d9b36 commit 4179769
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<Version>2.0.0.0-rc0</Version>
<Version>2.0.0.0-rc1</Version>
<Author>Zaitonn</Author>
<Copyright>Copyright (C) 2022 Zaitonn</Copyright>
<Product>Serein</Product>
Expand Down
3 changes: 1 addition & 2 deletions src/Serein.Core/Services/Commands/HardwareInfoProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,7 @@ void Try(
}
catch (Exception e)
{
_logger.LogError("更新信息失败:{}({})", e.Message, expression);
_logger.LogDebug(e, "更新信息失败");
_logger.LogDebug(e, "更新信息失败:({})", expression);
}
}
}
Expand Down
25 changes: 16 additions & 9 deletions src/Serein.Lite/Ui/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -261,16 +261,23 @@ private void ServerRemoveToolStripMenuItem_Click(object sender, EventArgs e)
return;
}

var id = serverPage
.MainTabControl.Controls[serverPage.MainTabControl.SelectedIndex]
.Tag?.ToString();

if (
!string.IsNullOrEmpty(id)
&& MessageBoxHelper.ShowDeleteConfirmation($"确定要删除此服务器配置({id})吗?")
)
try
{
var id = serverPage
.MainTabControl.Controls[serverPage.MainTabControl.SelectedIndex]
.Tag?.ToString();

if (
!string.IsNullOrEmpty(id)
&& MessageBoxHelper.ShowDeleteConfirmation($"确定要删除此服务器配置({id})吗?")
)
{
_serverManager.Remove(id);
}
}
catch (Exception ex)
{
_serverManager.Remove(id);
MessageBoxHelper.ShowWarningMsgBox("删除失败:\r\n" + ex.Message);
}
}

Expand Down

0 comments on commit 4179769

Please sign in to comment.