Skip to content

Commit

Permalink
Merge branch 'sam/logins-filtering-and-sorting' into sam/logins-authe…
Browse files Browse the repository at this point in the history
…ntication

* sam/logins-filtering-and-sorting:
  Avoid the default empty state appearing at unexpected times.
  • Loading branch information
samsymons committed Feb 21, 2022
2 parents 61b9dc6 + ecd6d68 commit bd62272
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
10 changes: 10 additions & 0 deletions DuckDuckGo/SecureVault/Model/PasswordManagementItemListModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,16 @@ final class PasswordManagementItemListModel: ObservableObject {
selected(item: nil)
}
}

func clear() {
update(items: [])
filter = ""
clearSelection()

// Setting items to an empty array will typically show the No Data empty state, but this call is used when
// the popover is closed so instead there should be no empty state.
emptyState = .none
}

func clearSelection() {
selected = nil
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -266,9 +266,7 @@ final class PasswordManagementViewController: NSViewController {
}

func clear() {
self.listModel?.update(items: [])
self.listModel?.filter = ""
self.listModel?.clearSelection()
self.listModel?.clear()
self.itemModel?.clearSecureVaultModel()
}

Expand Down

0 comments on commit bd62272

Please sign in to comment.