Skip to content

Commit

Permalink
PM-10401 Fixed key24 image and moved to switch logic in VaultGroupState.
Browse files Browse the repository at this point in the history
  • Loading branch information
fedemkr committed Oct 31, 2024
1 parent 7804b51 commit 7c360c7
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 18 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"images" : [
{
"filename" : "key24.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"preserves-vector-representation" : true,
"template-rendering-intent" : "template"
}
}
Binary file not shown.
22 changes: 8 additions & 14 deletions BitwardenShared/UI/Vault/Vault/VaultGroup/VaultGroupState.swift
Original file line number Diff line number Diff line change
Expand Up @@ -60,28 +60,22 @@ struct VaultGroupState: Equatable, Sendable {
// Don't show if there is data.
guard emptyData else { return false }

// If the collection or trash are empty, return false.
if case .collection = group {
return false
}
if case .sshKey = group {
return false
}
if case .trash = group {
switch group {
case .collection, .sshKey, .trash:
return false
default:
return true
}
return true
}

/// Whether to show the add item floating action button.
var showAddItemFloatingActionButton: Bool {
if case .sshKey = group {
return false
}
if case .trash = group {
switch group {
case .sshKey, .trash:
return false
default:
return true
}
return true
}

/// Whether to show the special web icons.
Expand Down
4 changes: 2 additions & 2 deletions BitwardenShared/UI/Vault/Vault/VaultList/VaultListItem.swift
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ extension VaultListItem {
case .secureNote:
Asset.Images.file24
case .sshKey:
Asset.Images.key16
Asset.Images.key24
}
case let .group(group, _):
switch group {
Expand All @@ -112,7 +112,7 @@ extension VaultListItem {
case .secureNote:
Asset.Images.file24
case .sshKey:
Asset.Images.key16
Asset.Images.key24
case .totp:
Asset.Images.clock24
case .trash:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ class VaultListItemTests: BitwardenTestCase { // swiftlint:disable:this type_bod
)
XCTAssertEqual(
VaultListItem(cipherView: .fixture(type: .sshKey))?.icon.name,
Asset.Images.key16.name
Asset.Images.key24.name
)

XCTAssertEqual(
Expand Down Expand Up @@ -173,7 +173,7 @@ class VaultListItemTests: BitwardenTestCase { // swiftlint:disable:this type_bod
)
XCTAssertEqual(
VaultListItem(id: "", itemType: .group(.sshKey, 1)).icon.name,
Asset.Images.key16.name
Asset.Images.key24.name
)
XCTAssertEqual(
VaultListItem(id: "", itemType: .group(.totp, 1)).icon.name,
Expand Down

0 comments on commit 7c360c7

Please sign in to comment.