Skip to content
This repository has been archived by the owner on May 10, 2024. It is now read-only.

Commit

Permalink
Fix #7844: Fix bug where backgroundView on stats is invisible (#7845)
Browse files Browse the repository at this point in the history
Fix bug where backgroundView on stats don't show or it shows multiple times causing UI issues.
  • Loading branch information
Brandon-T authored Aug 8, 2023
1 parent eb78399 commit dbdd7d7
Showing 1 changed file with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -175,16 +175,11 @@ class BraveShieldStatsView: SpringButton {

var isPrivateBrowsing: Bool = false {
didSet {
if oldValue == isPrivateBrowsing {
if backgroundView.superview != nil {
return
}

if isPrivateBrowsing {
backgroundView.removeFromSuperview()
topStackView.arrangedSubviews.forEach {
$0.removeFromSuperview()
}
} else if Preferences.NewTabPage.showNewTabPrivacyHub.value {
if !isPrivateBrowsing && Preferences.NewTabPage.showNewTabPrivacyHub.value {
backgroundView.backgroundColor = .init(white: 0, alpha: 0.25)
backgroundView.layer.cornerRadius = 12
backgroundView.layer.cornerCurve = .continuous
Expand Down

0 comments on commit dbdd7d7

Please sign in to comment.