From 436df5798e7c6d01f4ac2e5d2b665b09a1eae8c1 Mon Sep 17 00:00:00 2001 From: hishitetsu <66369541+hishitetsu@users.noreply.github.com> Date: Tue, 28 Mar 2023 10:42:09 +0900 Subject: [PATCH] Update MainWindow.xaml.cs --- src/Files.App/MainWindow.xaml.cs | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/Files.App/MainWindow.xaml.cs b/src/Files.App/MainWindow.xaml.cs index d936db8dc581..e555bdcdd51a 100644 --- a/src/Files.App/MainWindow.xaml.cs +++ b/src/Files.App/MainWindow.xaml.cs @@ -75,10 +75,9 @@ public async Task InitializeApplication(object activatedEventArgs) // WINUI3 bug: when launching from commandline the argument is not ICommandLineActivatedEventArgs (#10370) var ppm = CommandLineParser.ParseUntrustedCommands(launchArgs.Arguments); if (ppm.IsEmpty()) - { - ppm = new ParsedCommands() { new ParsedCommand() { Type = ParsedCommandType.Unknown, Args = new() { "." } } }; - } - await InitializeFromCmdLineArgs(rootFrame, ppm); + rootFrame.Navigate(typeof(MainPage), null, new SuppressNavigationTransitionInfo()); + else + await InitializeFromCmdLineArgs(rootFrame, ppm); } else if (rootFrame.Content is null) { @@ -123,10 +122,9 @@ public async Task InitializeApplication(object activatedEventArgs) case "cmd": var ppm = CommandLineParser.ParseUntrustedCommands(unescapedValue); if (ppm.IsEmpty()) - { - ppm = new ParsedCommands() { new ParsedCommand() { Type = ParsedCommandType.Unknown, Args = new() { "." } } }; - } - await InitializeFromCmdLineArgs(rootFrame, ppm); + rootFrame.Navigate(typeof(MainPage), null, new SuppressNavigationTransitionInfo()); + else + await InitializeFromCmdLineArgs(rootFrame, ppm); break; } }