Skip to content

Commit

Permalink
fix: cannot update environment
Browse files Browse the repository at this point in the history
  • Loading branch information
AuroraZiling committed Feb 5, 2024
1 parent bbd4fd5 commit a82ad69
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 2 deletions.
18 changes: 18 additions & 0 deletions src/PipManager/Languages/Lang.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions src/PipManager/Languages/Lang.resx
Original file line number Diff line number Diff line change
Expand Up @@ -670,4 +670,10 @@ Other sources are faster to connect to, but may be incomplete.</value>
<data name="Search_Query_Timeout" xml:space="preserve">
<value>Timeout</value>
</data>
<data name="EnvironmentCheckEnvironmentUpdate_CurrentVersion" xml:space="preserve">
<value>Current: </value>
</data>
<data name="EnvironmentCheckEnvironmentUpdate_LatestVersion" xml:space="preserve">
<value>Latest: </value>
</data>
</root>
6 changes: 6 additions & 0 deletions src/PipManager/Languages/Lang.zh-cn.resx
Original file line number Diff line number Diff line change
Expand Up @@ -670,4 +670,10 @@
<data name="Search_Query_Timeout" xml:space="preserve">
<value>查询超时</value>
</data>
<data name="EnvironmentCheckEnvironmentUpdate_CurrentVersion" xml:space="preserve">
<value>当前版本: </value>
</data>
<data name="EnvironmentCheckEnvironmentUpdate_LatestVersion" xml:space="preserve">
<value>最新版本: </value>
</data>
</root>
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ private async Task CheckEnvironmentUpdate()
await Task.Run(async () =>
{
var versions = await environmentService.GetVersions("pip");
if (versions.Status != 0)
if (versions.Status == 0)
{
latest = versions.Versions!.Last();
}
Expand All @@ -122,7 +122,7 @@ await Task.Run(async () =>
if (latest != current && latest != string.Empty)
{
Log.Information($"[Environment] Environment update available ({current} => {latest})");
var message = $"{Lang.ContentDialog_Message_FindUpdate}\n\n{current} => {latest}";
var message = $"{Lang.ContentDialog_Message_FindUpdate}\n\n{Lang.EnvironmentCheckEnvironmentUpdate_CurrentVersion}{current}\n{Lang.EnvironmentCheckEnvironmentUpdate_LatestVersion}{latest}";
var result = await contentDialogService.ShowSimpleDialogAsync(ContentDialogCreateOptions.Notice(message));
if (result == ContentDialogResult.Primary)
{
Expand Down

0 comments on commit a82ad69

Please sign in to comment.