Compare commits
3
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
01f28cf044 | ||
|
|
37939b84ac | ||
|
|
9c8e0dcdb6 |
+8
-10
@@ -2,6 +2,7 @@ using Microsoft.Win32;
|
|||||||
using System;
|
using System;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Media;
|
using System.Windows.Media;
|
||||||
|
using System.Windows.Threading;
|
||||||
|
|
||||||
namespace ClaudeCheckerWindows;
|
namespace ClaudeCheckerWindows;
|
||||||
|
|
||||||
@@ -14,20 +15,17 @@ public static class ThemeManager
|
|||||||
{
|
{
|
||||||
IsDark = ReadIsDark();
|
IsDark = ReadIsDark();
|
||||||
Apply();
|
Apply();
|
||||||
SystemEvents.UserPreferenceChanged += OnPreferenceChanged;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void OnPreferenceChanged(object sender, UserPreferenceChangedEventArgs e)
|
var timer = new DispatcherTimer { Interval = TimeSpan.FromSeconds(5) };
|
||||||
{
|
timer.Tick += (_, _) =>
|
||||||
if (e.Category != UserPreferenceCategory.General) return;
|
|
||||||
var nowDark = ReadIsDark();
|
|
||||||
if (nowDark == IsDark) return;
|
|
||||||
IsDark = nowDark;
|
|
||||||
Application.Current.Dispatcher.Invoke(() =>
|
|
||||||
{
|
{
|
||||||
|
var nowDark = ReadIsDark();
|
||||||
|
if (nowDark == IsDark) return;
|
||||||
|
IsDark = nowDark;
|
||||||
Apply();
|
Apply();
|
||||||
ThemeChanged?.Invoke();
|
ThemeChanged?.Invoke();
|
||||||
});
|
};
|
||||||
|
timer.Start();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static bool ReadIsDark()
|
private static bool ReadIsDark()
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
|
using System.Reflection;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.IO.Compression;
|
using System.IO.Compression;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
@@ -55,7 +56,11 @@ public class UpdateManager : INotifyPropertyChanged
|
|||||||
|
|
||||||
public string CurrentVersion =>
|
public string CurrentVersion =>
|
||||||
System.Reflection.Assembly.GetExecutingAssembly()
|
System.Reflection.Assembly.GetExecutingAssembly()
|
||||||
.GetName().Version?.ToString(3) ?? "1.0.0";
|
.GetCustomAttribute<System.Reflection.AssemblyInformationalVersionAttribute>()
|
||||||
|
?.InformationalVersion.Split('+')[0]
|
||||||
|
?? "1.0.0";
|
||||||
|
|
||||||
|
private bool IsPreReleaseBuild => CurrentVersion.Contains('-');
|
||||||
|
|
||||||
public UpdateManager()
|
public UpdateManager()
|
||||||
{
|
{
|
||||||
@@ -91,7 +96,8 @@ public class UpdateManager : INotifyPropertyChanged
|
|||||||
LatestBetaVersion = beta.Version;
|
LatestBetaVersion = beta.Version;
|
||||||
BetaAvailable = true;
|
BetaAvailable = true;
|
||||||
|
|
||||||
if (BetaChannel && IsNewer(beta.Version, LatestVersion))
|
// Show beta update if user opted in, or if they're already running a beta
|
||||||
|
if ((BetaChannel || IsPreReleaseBuild) && IsNewer(beta.Version, LatestVersion))
|
||||||
{
|
{
|
||||||
LatestVersion = beta.Version;
|
LatestVersion = beta.Version;
|
||||||
ReleaseNotes = beta.Notes ?? "";
|
ReleaseNotes = beta.Notes ?? "";
|
||||||
|
|||||||
Reference in New Issue
Block a user