Browse Source

Fix Update button not disabling when no update is found

Ruben 5 days ago
parent
commit
9d4b1bd1a7

+ 1 - 1
src/PicView.Avalonia/Update/UpdateManager.cs

@@ -28,7 +28,7 @@ public static class UpdateManager
 
 #if DEBUG
     // ReSharper disable once ConvertToConstant.Local
-    private static readonly bool ForceUpdate = true;
+    private static readonly bool ForceUpdate = false;
 #endif
 
     /// <summary>

+ 2 - 2
src/PicView.Avalonia/ViewModels/AboutViewModel.cs

@@ -14,8 +14,8 @@ public class AboutViewModel : IDisposable
     public BindableReactiveProperty<bool> IsHitTestVisible { get; } = new(true);
     public BindableReactiveProperty<double> WindowOpacity { get; } = new(1);
     public BindableReactiveProperty<string?> UpdateStatusText { get; } = new();
-    
-    public BindableReactiveProperty<bool> IsUpdateAvailable { get; } = new();
+
+    public BindableReactiveProperty<bool> IsUpdateAvailable { get; } = new(true);
     public BindableReactiveProperty<string?> UpdateVersionNumber { get; } = new (VersionHelper.GetCurrentVersion());
 
     private readonly IPlatformSpecificUpdate _update;

+ 2 - 1
src/PicView.Avalonia/Views/Main/AboutView.axaml

@@ -211,6 +211,7 @@
                 IconHeight="14"
                 IconMargin="0,0,10,4"
                 IconWidth="14"
+                IsVisible="{CompiledBinding AboutView.IsUpdateAvailable.Value}"
                 Margin="0,10,0,15"
                 Text="{CompiledBinding Translation.CheckForUpdates.Value,
                                        Mode=OneWay}"
@@ -220,7 +221,7 @@
                 Classes="txt"
                 Foreground="{Binding Path=Foreground, ElementName=UpdateButton}"
                 HorizontalAlignment="Center"
-                IsVisible="{CompiledBinding AboutView.IsUpdateAvailable.Value}"
+                IsVisible="{CompiledBinding !AboutView.IsUpdateAvailable.Value}"
                 Margin="0,10,0,15"
                 Text="{CompiledBinding AboutView.UpdateStatusText.Value}"
                 x:Name="UpdateStatus" />