mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Use constructor injection for updater
This commit is contained in:
parent
c072012073
commit
39d7187713
2 changed files with 7 additions and 2 deletions
|
|
@ -23,10 +23,15 @@ namespace Flow.Launcher.Core
|
|||
{
|
||||
public class Updater
|
||||
{
|
||||
private readonly IPublicAPI API = Ioc.Default.GetRequiredService<IPublicAPI>();
|
||||
private readonly IPublicAPI API;
|
||||
|
||||
public string GitHubRepository { get; set; }
|
||||
|
||||
public Updater(IPublicAPI publicAPI)
|
||||
{
|
||||
API = publicAPI;
|
||||
}
|
||||
|
||||
public void Initialize(string gitHubRepository)
|
||||
{
|
||||
GitHubRepository = gitHubRepository;
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ namespace Flow.Launcher
|
|||
.UseContentRoot(AppContext.BaseDirectory)
|
||||
.ConfigureServices(services => services
|
||||
.AddSingleton(_ => _settings)
|
||||
.AddSingleton<Updater>()
|
||||
.AddSingleton(sp => new Updater(sp.GetRequiredService<IPublicAPI>()))
|
||||
.AddSingleton<Portable>()
|
||||
.AddSingleton<SettingWindowViewModel>()
|
||||
.AddSingleton<IAlphabet, PinyinAlphabet>()
|
||||
|
|
|
|||
Loading…
Reference in a new issue