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
5 changes: 4 additions & 1 deletion WooCommerce/Classes/Environment Keys/SafeAreaInsetsKey.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ struct SafeAreaInsetsKey: EnvironmentKey {
/// Returns the safe areas of the main window.
///
static var defaultValue: EdgeInsets {
guard let window = UIApplication.shared.windows.first else {

// Get the first window from all connected scenes
let scenes = UIApplication.shared.connectedScenes
guard let window = scenes.compactMap({ $0 as? UIWindowScene }).flatMap({ $0.windows }).first else {
return .zero
}

Expand Down