|
36 | 36 | using System.Threading.Tasks; |
37 | 37 | using Updatum; |
38 | 38 | using WinUIEx; |
| 39 | +using SetupCompletionDestination = OpenClaw.SetupEngine.UI.SetupCompletionDestination; |
39 | 40 | using SetupCompletedEventArgs = OpenClaw.SetupEngine.UI.SetupCompletedEventArgs; |
40 | 41 | using SetupWindow = OpenClaw.SetupEngine.UI.SetupWindow; |
41 | 42 |
|
@@ -604,7 +605,10 @@ private async Task OnLaunchedAsync(LaunchActivatedEventArgs args) |
604 | 605 | ?? (_startupArgs.Length > 1 && IsDeepLinkArg(_startupArgs[1]) |
605 | 606 | ? _startupArgs[1] : null) |
606 | 607 | ?? (string.Equals(_postSetupLaunch, "chat", StringComparison.OrdinalIgnoreCase) |
607 | | - ? $"{AppIdentity.ProtocolScheme}://chat" : null); |
| 608 | + ? $"{AppIdentity.ProtocolScheme}://chat" |
| 609 | + : string.Equals(_postSetupLaunch, "channels", StringComparison.OrdinalIgnoreCase) |
| 610 | + ? $"{AppIdentity.ProtocolScheme}://notifications" |
| 611 | + : null); |
608 | 612 | if (deepLink != null) |
609 | 613 | { |
610 | 614 | SendDeepLinkToRunningInstance(deepLink); |
@@ -959,6 +963,10 @@ _dispatcherQueue is null |
959 | 963 | { |
960 | 964 | await HandleDeepLinkAsync($"{AppIdentity.ProtocolScheme}://chat"); |
961 | 965 | } |
| 966 | + else if (!setupShownDuringStartup && string.Equals(_postSetupLaunch, "channels", StringComparison.OrdinalIgnoreCase)) |
| 967 | + { |
| 968 | + ShowHub("channels"); |
| 969 | + } |
962 | 970 |
|
963 | 971 | Logger.Info("Application started (WinUI 3)"); |
964 | 972 | } |
@@ -4153,11 +4161,13 @@ private void OnSetupAdvancedSetupRequested(object? sender, EventArgs e) |
4153 | 4161 |
|
4154 | 4162 | private void OnSetupCompleted(object? sender, SetupCompletedEventArgs e) => |
4155 | 4163 | AsyncEventHandlerGuard.Run( |
4156 | | - () => RestartAfterSetupAsync(e.EnableAutoStart), |
| 4164 | + () => RestartAfterSetupAsync(e.EnableAutoStart, e.Destination), |
4157 | 4165 | new AppLogger(), |
4158 | 4166 | nameof(OnSetupCompleted)); |
4159 | 4167 |
|
4160 | | - private async Task RestartAfterSetupAsync(bool enableAutoStart) |
| 4168 | + private async Task RestartAfterSetupAsync( |
| 4169 | + bool enableAutoStart, |
| 4170 | + SetupCompletionDestination destination) |
4161 | 4171 | { |
4162 | 4172 | var exePath = ResolveCurrentExecutablePath(); |
4163 | 4173 | if (string.IsNullOrWhiteSpace(exePath) || !File.Exists(exePath)) |
@@ -4188,7 +4198,7 @@ private async Task RestartAfterSetupAsync(bool enableAutoStart) |
4188 | 4198 | psi.ArgumentList.Add("--wait-for-pid"); |
4189 | 4199 | psi.ArgumentList.Add(Environment.ProcessId.ToString(CultureInfo.InvariantCulture)); |
4190 | 4200 | psi.ArgumentList.Add("--post-setup-launch"); |
4191 | | - psi.ArgumentList.Add("chat"); |
| 4201 | + psi.ArgumentList.Add(destination == SetupCompletionDestination.Channels ? "channels" : "chat"); |
4192 | 4202 |
|
4193 | 4203 | var restarted = Process.Start(psi); |
4194 | 4204 | if (restarted == null) |
|
0 commit comments