Skip to content

Commit

Permalink
remove AppDelegateHelper
Browse files Browse the repository at this point in the history
  • Loading branch information
AigioL committed Aug 28, 2021
1 parent c5ee578 commit 2377f3e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/ST.Client.Desktop.Avalonia.App/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ static int Main(string[] args)
//if (activatedArgs != null) args = OnActivated(args, activatedArgs);
#elif !__MOBILE__
#if MAC
AppDelegateHelper.Init(args);
AppDelegate.Init(/*args*/);
FileSystemDesktopMac.InitFileSystem();
#else
FileSystemDesktop.InitFileSystem();
Expand Down
2 changes: 1 addition & 1 deletion src/ST.Client.Desktop.Mac/ServiceCollectionExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public static IServiceCollection AddDesktopPlatformService(this IServiceCollecti
if (OperatingSystem2.IsMacOS)
{
services.AddSingleton<IHttpPlatformHelper, PlatformHttpPlatformHelper>();
services.AddSingleton(AppDelegateHelper.Instance!);
services.AddSingleton(AppDelegate.Instance!);
services.AddSingleton<MacDesktopPlatformServiceImpl>();
services.AddSingleton<IPlatformService>(s => s.GetRequiredService<MacDesktopPlatformServiceImpl>());
services.AddSingleton<IDesktopPlatformService>(s => s.GetRequiredService<MacDesktopPlatformServiceImpl>());
Expand Down
5 changes: 1 addition & 4 deletions src/ST.Client.Desktop.Mac/UI/AppDelegate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,11 @@ public override void DidFinishLaunching(NSNotification notification)

NSRunningApplication.CurrentApplication.Activate(NSApplicationActivationOptions.ActivateIgnoringOtherWindows);
}
}

public static class AppDelegateHelper
{
static bool isInitialized;
internal static AppDelegate? Instance { get; private set; }

public static void Init(string[] args)
public static void Init(/*string[] args*/)
{
if (!isInitialized)
{
Expand Down

0 comments on commit 2377f3e

Please sign in to comment.