Skip to content

Commit

Permalink
Merge pull request #164 from niscy-eudiw/main
Browse files Browse the repository at this point in the history
WalletKit Update to 0.6.7
  • Loading branch information
stzouvaras authored Sep 13, 2024
2 parents f5342d7 + 92e6613 commit 226f150
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/eu-digital-identity-wallet/eudi-lib-ios-wallet-kit.git",
"state" : {
"revision" : "5e952df008bf0d7954372a0d53b9ec228e98dafb",
"version" : "0.6.6"
"revision" : "39dc4b004ce04911e1851194327dc987c9b740e8",
"version" : "0.6.7"
}
},
{
Expand Down
2 changes: 1 addition & 1 deletion Modules/logic-core/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ let package = Package(
dependencies: [
.package(
url: "https://github.com/eu-digital-identity-wallet/eudi-lib-ios-wallet-kit.git",
exact: "0.6.6"
exact: "0.6.7"
),
.package(
name: "logic-resources",
Expand Down
27 changes: 12 additions & 15 deletions Modules/logic-core/Sources/Controller/WalletKitController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,11 @@ final class WalletKitControllerImpl: WalletKitController {
}

public func clearDocuments(status: DocumentStatus) async throws {
return try await wallet.storage.deleteDocuments(status: status)
return try await wallet.deleteDocuments(status: status)
}

public func deleteDocument(with id: String, status: DocumentStatus) async throws {
return try await wallet.storage.deleteDocument(id: id, status: status)
return try await wallet.deleteDocument(id: id, status: status)
}

public func loadDocuments() async throws {
Expand Down Expand Up @@ -321,33 +321,30 @@ extension WalletKitController {
return .image(imageName.image)
}

guard let document = fetchDocument(with: documentId) else {
return .unavailable(LocalizableString.shared.get(with: .errorUnableFetchDocument))
}

// Convert the Stored models to their [Key: Value] array
let displayStrings = wallet.storage.mdocModels
.first(where: { $0.id == documentId })?.displayStrings
var displayStrings = document.displayStrings
.decodeGender()
.decodeUserPseudonym()
.parseDates(parser: parser)
.mapTrueFalseToLocalizable()

// Check if document type matches one of known models (pid or mdl)
guard var displayStrings = displayStrings else {
return .unavailable(LocalizableString.shared.get(with: .unavailableField))
}

if documentType == .MDL,
let mdl = wallet.storage.mdlModel {
if documentType == .MDL {

// Flatten properties in order to be made in a Key: Value structure
if let drivingPrivileges = mdl.getDrivingPrivileges(parser: parser) {
if let drivingPrivileges = document.getDrivingPrivileges(parser: parser) {
displayStrings.appendOrReplace(drivingPrivileges)
}

displayStrings.appendOrReplace(
contentsOf: decodeAgeOver(ageOverDictionary: mdl.ageOverXX)
contentsOf: decodeAgeOver(ageOverDictionary: document.ageOverXX)
)
} else if documentType == .PID, let pid = wallet.storage.pidModel {
} else if documentType == .PID {
displayStrings.appendOrReplace(
contentsOf: decodeAgeOver(ageOverDictionary: pid.ageOverXX)
contentsOf: decodeAgeOver(ageOverDictionary: document.ageOverXX)
)
}
// Find the first Value that Matches given Key for document
Expand Down

0 comments on commit 226f150

Please sign in to comment.