mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Add api to Http.cs & message shown up when error thrown
This commit is contained in:
parent
d0168b698c
commit
cfbdf294bb
2 changed files with 11 additions and 2 deletions
|
|
@ -9,6 +9,8 @@ using Flow.Launcher.Infrastructure.UserSettings;
|
|||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Threading;
|
||||
using System.Windows.Interop;
|
||||
using Flow.Launcher.Plugin;
|
||||
|
||||
namespace Flow.Launcher.Infrastructure.Http
|
||||
{
|
||||
|
|
@ -18,6 +20,8 @@ namespace Flow.Launcher.Infrastructure.Http
|
|||
|
||||
private static HttpClient client = new HttpClient();
|
||||
|
||||
public static IPublicAPI _api { get; set; }
|
||||
|
||||
static Http()
|
||||
{
|
||||
// need to be added so it would work on a win10 machine
|
||||
|
|
@ -77,7 +81,9 @@ namespace Flow.Launcher.Infrastructure.Http
|
|||
}
|
||||
catch(UriFormatException e)
|
||||
{
|
||||
Log.Exception("Http", "Unable to parse Uri", e);
|
||||
_api.ShowMsg("Please try again", "Unable to parse Http Proxy");
|
||||
Log.Exception("Flow.Launcher.Infrastructure.Http", "Unable to parse Uri", e);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -61,7 +61,6 @@ namespace Flow.Launcher
|
|||
_settingsVM = new SettingWindowViewModel(_updater, _portable);
|
||||
_settings = _settingsVM.Settings;
|
||||
|
||||
Http.Proxy = _settings.Proxy;
|
||||
|
||||
_alphabet.Initialize(_settings);
|
||||
_stringMatcher = new StringMatcher(_alphabet);
|
||||
|
|
@ -74,6 +73,10 @@ namespace Flow.Launcher
|
|||
await PluginManager.InitializePlugins(API);
|
||||
var window = new MainWindow(_settings, _mainVM);
|
||||
|
||||
Http._api = API;
|
||||
Http.Proxy = _settings.Proxy;
|
||||
|
||||
|
||||
Log.Info($"|App.OnStartup|Dependencies Info:{ErrorReporting.DependenciesInfo()}");
|
||||
|
||||
Current.MainWindow = window;
|
||||
|
|
|
|||
Loading…
Reference in a new issue