Skip to content

Commit

Permalink
Fix TrayIcon display
Browse files Browse the repository at this point in the history
  • Loading branch information
2dust committed Oct 5, 2024
1 parent fe895b1 commit 1f77c56
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions v2rayN/v2rayN.Desktop/App.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ public partial class App : Application

public override void Initialize()
{
Init();
AvaloniaXamlLoader.Load(this);

AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
Expand Down Expand Up @@ -47,26 +48,24 @@ private void OnStartup(string[]? Args)
//}

Logging.Setup();
Init();
Logging.LoggingEnabled(_config.guiItem.enableLog);
Logging.SaveLog($"v2rayN start up | {Utils.GetVersion()} | {Utils.GetExePath()}");
Logging.SaveLog($"{Environment.OSVersion} - {(Environment.Is64BitOperatingSystem ? 64 : 32)}");
Logging.ClearLogs();

Thread.CurrentThread.CurrentUICulture = new(_config.uiItem.currentLanguage);
}

private void Init()
{
if (ConfigHandler.LoadConfig(ref _config) != 0)
{
Logging.SaveLog($"Loading GUI configuration file is abnormal,please restart the application{Environment.NewLine}加载GUI配置文件异常,请重启应用");
//Logging.SaveLog($"Loading GUI configuration file is abnormal,please restart the application{Environment.NewLine}加载GUI配置文件异常,请重启应用");
Environment.Exit(0);
return;
}
LazyConfig.Instance.SetConfig(_config);
Locator.CurrentMutable.RegisterLazySingleton(() => new NoticeHandler(), typeof(NoticeHandler));

Thread.CurrentThread.CurrentUICulture = new(_config.uiItem.currentLanguage);

//Under Win10
if (Utils.IsWindows() && Environment.OSVersion.Version.Major < 10)
{
Expand Down

0 comments on commit 1f77c56

Please sign in to comment.