Skip to content

Commit

Permalink
fix: qr codes is not mandatory in pending state (#525)
Browse files Browse the repository at this point in the history
  • Loading branch information
javip97 authored Nov 9, 2023
1 parent e01467e commit 504efe8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pkg/link/link_state.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ type QRCodeMessage struct {
type State struct {
Status string `json:"status,omitempty"`
Message string `json:"message,omitempty"`
QRCode *string `json:"qrcode,omitempty"`
QRCode *string `json:"qrcode"`
}

// NewStatePending - TODO
Expand Down
4 changes: 2 additions & 2 deletions ui/src/adapters/api/credentials.ts
Original file line number Diff line number Diff line change
Expand Up @@ -448,13 +448,13 @@ export async function getIssuedQRCode({
}

export type ImportQRCode = {
qrCode: string;
qrCode?: string;
status: "done" | "pending" | "pendingPublish";
};

const importQRCodeParser = getStrictParser<ImportQRCode>()(
z.object({
qrCode: z.string(),
qrCode: z.string().optional(),
status: z.union([z.literal("done"), z.literal("pendingPublish"), z.literal("pending")]),
})
);
Expand Down
4 changes: 2 additions & 2 deletions ui/src/components/credentials/CredentialLinkQR.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ export function CredentialLinkQR() {
Missed the notification?
</Button>

{isModalOpen && (
{isModalOpen && importQRCheck.data.qrCode && (
<ClaimCredentialModal
onClose={() => setIsModalOpen(false)}
qrCode={importQRCheck.data.qrCode}
Expand All @@ -208,7 +208,7 @@ export function CredentialLinkQR() {
Missed the notification?
</Button>

{isModalOpen && (
{isModalOpen && importQRCheck.data.qrCode && (
<ClaimCredentialModal
onClose={() => setIsModalOpen(false)}
qrCode={importQRCheck.data.qrCode}
Expand Down

0 comments on commit 504efe8

Please sign in to comment.