Skip to content

Commit

Permalink
[BWA-55] Add Long Press Menu to Search (#194)
Browse files Browse the repository at this point in the history
  • Loading branch information
brant-livefront authored Nov 21, 2024
1 parent 309d296 commit d0a2899
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,9 @@ final class ItemListProcessor: StateProcessor<ItemListState, ItemListAction, Ite
private func deleteItem(_ id: String) async {
do {
try await services.authenticatorItemRepository.deleteAuthenticatorItem(id)
if !state.searchText.isEmpty {
state.searchResults = await searchItems(for: state.searchText)
}
state.toast = Toast(text: Localizations.itemDeleted)
} catch {
services.errorReporter.log(error: error)
Expand Down Expand Up @@ -323,6 +326,9 @@ final class ItemListProcessor: StateProcessor<ItemListState, ItemListAction, Ite
if showToast {
state.toast = Toast(text: Localizations.accountsSyncedFromBitwardenApp)
}
if !state.searchText.isEmpty {
state.searchResults = await searchItems(for: state.searchText)
}
}
} catch {
services.errorReporter.log(error: error)
Expand Down
12 changes: 2 additions & 10 deletions AuthenticatorShared/UI/Vault/ItemList/ItemList/ItemListView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -199,16 +199,8 @@ private struct SearchableItemListView: View {
ScrollView {
LazyVStack(spacing: 0) {
ForEach(store.state.searchResults) { item in
Button {
store.send(.itemPressed(item))
} label: {
itemListItemRow(
for: item,
isLastInSection: store.state.searchResults.last == item
)
.background(Asset.Colors.backgroundPrimary.swiftUIColor)
}
.accessibilityIdentifier("ItemCell")
buildRow(item: item, isLastInSection: store.state.searchResults.last == item)
.accessibilityIdentifier("ItemCell")
}
}
}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit d0a2899

Please sign in to comment.