diff --git a/pkg/link/link_state.go b/pkg/link/link_state.go index 858bacfac..b2f201467 100644 --- a/pkg/link/link_state.go +++ b/pkg/link/link_state.go @@ -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 diff --git a/ui/src/adapters/api/credentials.ts b/ui/src/adapters/api/credentials.ts index 56e776a38..0ca962f49 100644 --- a/ui/src/adapters/api/credentials.ts +++ b/ui/src/adapters/api/credentials.ts @@ -448,13 +448,13 @@ export async function getIssuedQRCode({ } export type ImportQRCode = { - qrCode: string; + qrCode?: string; status: "done" | "pending" | "pendingPublish"; }; const importQRCodeParser = getStrictParser()( z.object({ - qrCode: z.string(), + qrCode: z.string().optional(), status: z.union([z.literal("done"), z.literal("pendingPublish"), z.literal("pending")]), }) ); diff --git a/ui/src/components/credentials/CredentialLinkQR.tsx b/ui/src/components/credentials/CredentialLinkQR.tsx index fb5a9111d..2cfa060c0 100644 --- a/ui/src/components/credentials/CredentialLinkQR.tsx +++ b/ui/src/components/credentials/CredentialLinkQR.tsx @@ -186,7 +186,7 @@ export function CredentialLinkQR() { Missed the notification? - {isModalOpen && ( + {isModalOpen && importQRCheck.data.qrCode && ( setIsModalOpen(false)} qrCode={importQRCheck.data.qrCode} @@ -208,7 +208,7 @@ export function CredentialLinkQR() { Missed the notification? - {isModalOpen && ( + {isModalOpen && importQRCheck.data.qrCode && ( setIsModalOpen(false)} qrCode={importQRCheck.data.qrCode}