From fc315dd2c9f026cdcae566b2da930586bb724093 Mon Sep 17 00:00:00 2001 From: qhy040404 Date: Fri, 18 Oct 2024 08:52:42 +0800 Subject: [PATCH] disable update and predownload button if mihoyo api has something wrong 5.1 => 5.0 :+1: --- .../Snap.Hutao/ViewModel/Game/GamePackageViewModel.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Snap.Hutao/Snap.Hutao/ViewModel/Game/GamePackageViewModel.cs b/src/Snap.Hutao/Snap.Hutao/ViewModel/Game/GamePackageViewModel.cs index 1f74626d7e..eac4af91b5 100644 --- a/src/Snap.Hutao/Snap.Hutao/ViewModel/Game/GamePackageViewModel.cs +++ b/src/Snap.Hutao/Snap.Hutao/ViewModel/Game/GamePackageViewModel.cs @@ -80,7 +80,7 @@ public Version? PreVersion public string PreDownloadTitle { get => SH.FormatViewModelGamePackagePreVersion(PreVersion); } - public bool IsUpdateAvailable { get => LocalVersion != RemoteVersion; } + public bool IsUpdateAvailable { get => LocalVersion < RemoteVersion; } public bool IsPredownloadButtonEnabled { @@ -91,6 +91,11 @@ public bool IsPredownloadButtonEnabled return false; } + if (LocalVersion >= PreVersion) + { + return false; + } + if (!launchOptions.TryGetGameFileSystem(out _)) { return false;