Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion Sources/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5567,14 +5567,21 @@ final class AppDelegate: NSObject, NSApplicationDelegate, UNUserNotificationCent
presentCloudWelcomeIfNeeded(over: window)
}

/// Once per Mac, after the first main window is up. Tests never see it.
/// In release builds, once per Mac after the first main window is up. Tests
/// never see it; debug builds can open it from Help when needed.
private func presentCloudWelcomeIfNeeded(over window: NSWindow) {
#if DEBUG
// Keep the first-run welcome available from Help while iterating on the
// app, but do not interrupt every development launch with it.
return
#else
let env = ProcessInfo.processInfo.environment
guard !isRunningUnderXCTestCached, !isRunningUnderXCTest(env), env["CMUX_UI_TEST_MODE"] != "1" else { return }
// Next turn of the main loop, so the window is on screen to place it over.
DispatchQueue.main.async { [weak self, weak window] in
self?.cloudWelcomeWindowController.presentIfNeeded(over: window)
}
#endif
}

#if DEBUG
Expand Down
Loading