Skip to content

Commit 74c7453

Browse files
authored
Bugfix FXIOS-14265 [Experiment] The ToU bottom sheet appears when focusing a tab with a website (#31057)
1 parent da77816 commit 74c7453

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

firefox-ios/Client/Coordinators/Browser/BrowserCoordinator.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1166,6 +1166,15 @@ class BrowserCoordinator: BaseCoordinator,
11661166
// MARK: - Terms of Use
11671167

11681168
func showTermsOfUse(context: TriggerContext = .appLaunch) {
1169+
/// For .appLaunch and .appBecameActive, we show ToU
1170+
/// on top of standard homepage or any website
1171+
/// For case .homepageOpened, ToU should be displayed only on
1172+
/// standard homepage or blank page
1173+
/// (not on custom URL homepage/new tab, not on regular websites)
1174+
if let selectedTab = tabManager.selectedTab, context == .homepageOpened {
1175+
guard selectedTab.isFxHomeTab || selectedTab.url == nil else { return }
1176+
}
1177+
11691178
guard !childCoordinators.contains(where: { $0 is TermsOfUseCoordinator }) else {
11701179
return // route is handled with existing child coordinator
11711180
}

0 commit comments

Comments
 (0)