chore: 修改版本更新提示逻辑

This commit is contained in:
uye
2025-04-20 15:48:04 +08:00
parent a89f985053
commit 2c8d5ccb94
3 changed files with 17 additions and 4 deletions

View File

@@ -682,13 +682,13 @@ namespace MaaWpfGui.ViewModels.UI
var rvm = (RootViewModel)this.Parent;
string updateTip = string.Empty;
var updateTag = Instances.VersionUpdateViewModel.UpdateTag;
var newVersionFoundInfo = VersionUpdateSettings.NewVersionFoundInfo;
var coreVersion = VersionUpdateSettingsUserControlModel.CoreVersion;
var startupUpdateCheck = VersionUpdateSettings.StartupUpdateCheck;
var isDebug = Instances.VersionUpdateViewModel.IsDebugVersion();
if (updateTag != coreVersion && !isDebug && !string.IsNullOrEmpty(updateTag) && startupUpdateCheck)
if (newVersionFoundInfo != coreVersion && !isDebug && !string.IsNullOrEmpty(newVersionFoundInfo) && startupUpdateCheck)
{
updateTip = $"{LocalizationHelper.GetString("NewVersionFoundTitle")}: {updateTag} - ";
updateTip = $"{LocalizationHelper.GetString("NewVersionFoundTitle")}: {newVersionFoundInfo} - ";
}
var newResourceFoundInfo = VersionUpdateSettings.NewResourceFoundInfo;

View File

@@ -82,7 +82,7 @@ public class VersionUpdateViewModel : Screen
{
SetAndNotify(ref _updateTag, value);
ConfigurationHelper.SetGlobalValue(ConfigurationKeys.VersionName, value);
Instances.SettingsViewModel.UpdateWindowTitle();
SettingsViewModel.VersionUpdateSettings.NewVersionFoundInfo = value;
}
}
@@ -1154,6 +1154,7 @@ public class VersionUpdateViewModel : Screen
public bool IsDebugVersion(string? version = null)
{
return false;
version ??= _curVersion;
// match case 1: DEBUG VERSION

View File

@@ -106,6 +106,18 @@ public class VersionUpdateSettingsUserControlModel : PropertyChangedBase
}
}
private string _newVersionFoundInfo = string.Empty;
public string NewVersionFoundInfo
{
get => _newVersionFoundInfo;
set
{
SetAndNotify(ref _newVersionFoundInfo, value);
Instances.SettingsViewModel.UpdateWindowTitle();
}
}
/// <summary>
/// Gets or sets the resource version.
/// </summary>