Skip to content

Commit

Permalink
speculative fix for set bars visibility crashes (#3442)
Browse files Browse the repository at this point in the history
Task/Issue URL:
https://app.asana.com/0/392891325557410/1208558176511823/f
Tech Design URL:
CC:

**Description**:
Speculative fix for related crashes by preventing stack overflow.

**Steps to test this PR**:
1. Run the app and browse sites.  
2. Swipe and down and make sure the bars are hidden/shown as expected
4. Switch orientations and try again
5. Test on phone and iPad
  • Loading branch information
brindy authored Oct 16, 2024
1 parent ee8e64d commit d6bad8c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/DuckDuckGo/BrowserServicesKit",
"state" : {
"revision" : "e0c0c85c18372f73fb97c5cf070f1de70c906a1f",
"version" : "199.1.0"
"revision" : "ffcbeb215c53e29b10cf511a98468a4456f6b965",
"version" : "199.2.0"
}
},
{
Expand Down Expand Up @@ -138,7 +138,7 @@
{
"identity" : "swift-argument-parser",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-argument-parser",
"location" : "https://github.com/apple/swift-argument-parser.git",
"state" : {
"revision" : "0fbc8848e389af3bb55c182bc19ca9d5dc2f255b",
"version" : "1.4.0"
Expand Down
7 changes: 4 additions & 3 deletions DuckDuckGo/MainViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1735,12 +1735,13 @@ extension MainViewController: BrowserChromeDelegate {
self.viewCoordinator.navigationBarContainer.alpha = percent
self.viewCoordinator.tabBarContainer.alpha = percent
self.viewCoordinator.toolbar.alpha = percent

self.view.layoutIfNeeded()
}

if animated {
UIView.animate(withDuration: ChromeAnimationConstants.duration, animations: updateBlock)
UIView.animate(withDuration: ChromeAnimationConstants.duration) {
updateBlock()
self.view.layoutIfNeeded()
}
} else {
updateBlock()
}
Expand Down

0 comments on commit d6bad8c

Please sign in to comment.