Skip to content

Commit

Permalink
Fixed to get background image according to credential.
Browse files Browse the repository at this point in the history
  • Loading branch information
moratori committed Jul 8, 2024
1 parent 72d8778 commit f527509
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions tw2023_wallet/datastore/CredentialDataManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,9 @@ extension Datastore_CredentialData {
}
}

private func getBackgroundImage() -> String? {
private func getBackgroundImage(credentialType: String) -> String? {
guard let metaData = self.parsedMetaData(),
let supportedName = metaData.credentialsSupported.keys.first, // todo: 1つめを前提としている
let supported = metaData.credentialsSupported[supportedName],
let supported = metaData.credentialsSupported[credentialType],
let displays = supported.display,
let firstDisplay = displays.first, // todo: 1つめを前提としている
let backgroundImageUrl = firstDisplay.backgroundImage
Expand Down Expand Up @@ -161,7 +160,7 @@ extension Datastore_CredentialData {
issuer: issuer,
issuerDisplayName: issuerName,
issuedAt: iat,
backgroundImageUrl: getBackgroundImage(),
backgroundImageUrl: getBackgroundImage(credentialType: self.type),
credentialType: self.type,
disclosure: disclosure,
qrDisplay: self.generateQRDisplay(),
Expand Down

0 comments on commit f527509

Please sign in to comment.