Skip to content

Commit

Permalink
PM-11522 - Large gap at the top of the autofill list after canceling …
Browse files Browse the repository at this point in the history
…a search (#935)
  • Loading branch information
phil-livefront committed Sep 16, 2024
1 parent 6f6ee54 commit 6eeaa1b
Showing 1 changed file with 29 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -186,31 +186,39 @@ private struct VaultAutofillListSearchableView: View {
/// The content displayed in the view.
@ViewBuilder
private func contentView() -> some View {
if isSearching {
searchContentView()
} else {
if store.state.vaultListSections.isEmpty {
EmptyContentView(
image: Asset.Images.openSource.swiftUIImage,
text: store.state.emptyViewMessage
) {
Button {
store.send(.addTapped(fromToolbar: false))
} label: {
Label {
Text(store.state.emptyViewButtonText)
} icon: {
Asset.Images.plus.swiftUIImage
.imageStyle(.accessoryIcon(
color: Asset.Colors.textPrimaryInverted.swiftUIColor,
scaleWithFont: true
))
ZStack {
let isSearching = isSearching
|| !store.state.searchText.isEmpty
|| !store.state.ciphersForSearch.isEmpty

Group {
if store.state.vaultListSections.isEmpty {
EmptyContentView(
image: Asset.Images.openSource.swiftUIImage,
text: store.state.emptyViewMessage
) {
Button {
store.send(.addTapped(fromToolbar: false))
} label: {
Label {
Text(store.state.emptyViewButtonText)
} icon: {
Asset.Images.plus.swiftUIImage
.imageStyle(.accessoryIcon(
color: Asset.Colors.textPrimaryInverted.swiftUIColor,
scaleWithFont: true
))
}
}
}
} else {
cipherListView(store.state.vaultListSections)
}
} else {
cipherListView(store.state.vaultListSections)
}
.hidden(isSearching)

searchContentView()
.hidden(!isSearching)
}
}

Expand Down

0 comments on commit 6eeaa1b

Please sign in to comment.