Skip to content

Commit

Permalink
Only activate scene when not active already (#3333)
Browse files Browse the repository at this point in the history
  • Loading branch information
bgoncal authored Jan 15, 2025
1 parent 7ec6691 commit 1d2130e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Sources/App/Scenes/SceneManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,11 @@ final class SceneManager {
let options = UIScene.ActivationRequestOptions()
options.requestingScene = active

// Only activate scene if not activated already
guard UIApplication.shared.connectedScenes.contains(where: { $0 != active }) else {
return .value(delegate)
}

// Guarantee it runs on main thread when coming from widgets
DispatchQueue.main.async {
if #available(iOS 17.0, *) {
Expand Down

0 comments on commit 1d2130e

Please sign in to comment.