feat: 修改 IsFirstBootAfterUpdate 的处理方式

更新完设成 True,弹完窗设成 False
This commit is contained in:
zzyyyl
2023-03-05 17:52:08 +08:00
parent f43c07ba80
commit 97358acea6
2 changed files with 14 additions and 12 deletions

View File

@@ -85,6 +85,7 @@ namespace MaaWpfGui
{
if (_versionUpdateViewModel.IsFirstBootAfterUpdate)
{
_versionUpdateViewModel.IsFirstBootAfterUpdate = false;
_windowManager.ShowWindow(_versionUpdateViewModel);
}
else
@@ -93,6 +94,7 @@ namespace MaaWpfGui
if (ret == VersionUpdateViewModel.CheckUpdateRetT.OK)
{
_versionUpdateViewModel.IsFirstBootAfterUpdate = true;
_versionUpdateViewModel.AskToRestart();
}
}

View File

@@ -125,10 +125,20 @@ namespace MaaWpfGui
set => SetAndNotify(ref _updateUrl, value);
}
private bool _isFirstBootAfterUpdate = Convert.ToBoolean(ViewStatusStorage.Get("VersionUpdate.isfirstboot", bool.FalseString));
/// <summary>
/// Gets a value indicating whether it is the first boot after updating.
/// Gets or sets a value indicating whether it is the first boot after updating.
/// </summary>
public bool IsFirstBootAfterUpdate => UpdateTag != string.Empty && UpdateTag == _curVersion;
public bool IsFirstBootAfterUpdate
{
get => _isFirstBootAfterUpdate;
set
{
SetAndNotify(ref _isFirstBootAfterUpdate, value);
ViewStatusStorage.Set("VersionUpdate.isfirstboot", value.ToString());
}
}
private string _updatePackageName = ViewStatusStorage.Get("VersionUpdate.package", string.Empty);
@@ -960,16 +970,6 @@ namespace MaaWpfGui
}
}
/// <summary>
/// Closes view model.
/// </summary>
public void Close()
{
RequestClose();
/* UpdateTag = string.Empty; */
/* UpdateInfo = string.Empty; */
}
/// <summary>
/// The event handler of opening hyperlink.
/// </summary>