diff --git a/Flow.Launcher.Core/Updater.cs b/Flow.Launcher.Core/Updater.cs index ec0b8bd57..86e2a5197 100644 --- a/Flow.Launcher.Core/Updater.cs +++ b/Flow.Launcher.Core/Updater.cs @@ -22,21 +22,20 @@ namespace Flow.Launcher.Core { public class Updater { + public string GitHubReleaseRepository { get; } + public string GitHubPrereleaseRepository { get; } + public bool UpdateToPrerelease { get; set; } - - // TODO - public const string ReleaseRepository = "https://github.com/Flow-Launcher/Flow.Launcher"; - public const string PrereleaseRepository = "https://github.com/Flow-Launcher/Prereleases"; - - // TODO - public string GitHubRepository => UpdateToPrerelease ? PrereleaseRepository : ReleaseRepository; + + public string GitHubRepository => UpdateToPrerelease ? GitHubPrereleaseRepository : GitHubReleaseRepository; private readonly IPublicAPI _api; - public Updater(IPublicAPI publicAPI, string gitHubRepository) + public Updater(IPublicAPI publicAPI, string gitHubReleaseRepository, string gitHubPrereleaseRepository) { _api = publicAPI; - GitHubRepository = gitHubRepository; + GitHubReleaseRepository = gitHubReleaseRepository; + GitHubPrereleaseRepository = gitHubPrereleaseRepository; } private SemaphoreSlim UpdateLock { get; } = new SemaphoreSlim(1); diff --git a/Flow.Launcher/App.xaml.cs b/Flow.Launcher/App.xaml.cs index fa09f4fa7..c862bfde4 100644 --- a/Flow.Launcher/App.xaml.cs +++ b/Flow.Launcher/App.xaml.cs @@ -55,7 +55,7 @@ namespace Flow.Launcher .UseContentRoot(AppContext.BaseDirectory) .ConfigureServices(services => services .AddSingleton(_ => _settings) - .AddSingleton(sp => new Updater(sp.GetRequiredService(), Launcher.Properties.Settings.Default.GithubRepo)) + .AddSingleton(sp => new Updater(sp.GetRequiredService(), Launcher.Properties.Settings.Default.GithubRepo, Launcher.Properties.Settings.Default.PrereleaseRepo)) .AddSingleton() .AddSingleton() .AddSingleton()