@@ -16,6 +16,11 @@ class TabManagerMiddleware: BookmarksRefactorFeatureFlagProvider,
16
16
private let inactiveTabTelemetry = InactiveTabsTelemetry ( )
17
17
private let bookmarksSaver : BookmarksSaver
18
18
19
+ private var isTabTrayUIExperimentsEnabled : Bool {
20
+ return featureFlags. isFeatureEnabled ( . tabTrayUIExperiments, checking: . buildOnly)
21
+ && UIDevice . current. userInterfaceIdiom != . pad
22
+ }
23
+
19
24
init ( profile: Profile = AppContainer . shared. resolve ( ) ,
20
25
logger: Logger = DefaultLogger . shared,
21
26
bookmarksSaver: BookmarksSaver ? = nil ) {
@@ -384,15 +389,13 @@ class TabManagerMiddleware: BookmarksRefactorFeatureFlagProvider,
384
389
let shouldDismiss = await self . closeTab ( with: tabUUID, uuid: uuid, isPrivate: isPrivate)
385
390
triggerRefresh ( uuid: uuid, isPrivate: isPrivate)
386
391
387
- let isTabTrayExperimentEnabled = featureFlags. isFeatureEnabled ( . tabTrayUIExperiments,
388
- checking: . buildOnly)
389
392
if isPrivate && tabManager ( for: uuid) . privateTabs. isEmpty {
390
393
let didLoadAction = TabPanelViewAction ( panelType: isPrivate ? . privateTabs : . tabs,
391
394
windowUUID: uuid,
392
395
actionType: TabPanelViewActionType . tabPanelDidLoad)
393
396
store. dispatch ( didLoadAction)
394
397
395
- if !isTabTrayExperimentEnabled {
398
+ if !isTabTrayUIExperimentsEnabled {
396
399
let toastAction = TabPanelMiddlewareAction ( toastType: . closedSingleTab,
397
400
windowUUID: uuid,
398
401
actionType: TabPanelMiddlewareActionType . showToast)
@@ -403,14 +406,14 @@ class TabManagerMiddleware: BookmarksRefactorFeatureFlagProvider,
403
406
actionType: TabTrayActionType . dismissTabTray)
404
407
store. dispatch ( dismissAction)
405
408
406
- if !isTabTrayExperimentEnabled {
409
+ if !isTabTrayUIExperimentsEnabled {
407
410
let toastAction = GeneralBrowserAction ( toastType: . closedSingleTab,
408
411
windowUUID: uuid,
409
412
actionType: GeneralBrowserActionType . showToast)
410
413
store. dispatch ( toastAction)
411
414
}
412
415
addNewTabIfPrivate ( uuid: uuid)
413
- } else if !isTabTrayExperimentEnabled {
416
+ } else if !isTabTrayUIExperimentsEnabled {
414
417
let toastAction = TabPanelMiddlewareAction ( toastType: . closedSingleTab,
415
418
windowUUID: uuid,
416
419
actionType: TabPanelMiddlewareActionType . showToast)
@@ -494,15 +497,13 @@ class TabManagerMiddleware: BookmarksRefactorFeatureFlagProvider,
494
497
actionType: TabPanelMiddlewareActionType . refreshTabs)
495
498
store. dispatch ( action)
496
499
497
- let isTabTrayExperimentEnabled = featureFlags. isFeatureEnabled ( . tabTrayUIExperiments,
498
- checking: . buildOnly)
499
- if tabsState. isPrivateMode && !isTabTrayExperimentEnabled {
500
+ if tabsState. isPrivateMode && !isTabTrayUIExperimentsEnabled {
500
501
let action = TabPanelMiddlewareAction ( toastType: . closedAllTabs( count: privateCount) ,
501
502
windowUUID: uuid,
502
503
actionType: TabPanelMiddlewareActionType . showToast)
503
504
store. dispatch ( action)
504
505
} else {
505
- if !isTabTrayExperimentEnabled {
506
+ if !isTabTrayUIExperimentsEnabled {
506
507
let toastAction = GeneralBrowserAction ( toastType: . closedAllTabs( count: normalCount) ,
507
508
windowUUID: uuid,
508
509
actionType: GeneralBrowserActionType . showToast)
0 commit comments