diff --git a/src/api/qrCode.ts b/src/api/qrCode.ts index 8b53a8d..51c91cc 100644 --- a/src/api/qrCode.ts +++ b/src/api/qrCode.ts @@ -43,5 +43,13 @@ export const createQrCodeDocument = async ( return qrCodeDoc } -export const getQrCodeDocument = (uri: string) => - qrCodeDbLocal.get(`qr_code:${uri}`) +export const getQrCodeDocument = (uri: string) => { + try { + return qrCodeDbLocal.get(`qr_code:${uri}`) + } catch (e) { + if ((e as { code: string }).code === 'not_found') { + return qrCodeDbRemote.get(`qr_code:${uri}`) + } + throw e + } +} diff --git a/src/components/create/CreateActionsSection.vue b/src/components/create/CreateActionsSection.vue index 43050d9..f73ca3b 100644 --- a/src/components/create/CreateActionsSection.vue +++ b/src/components/create/CreateActionsSection.vue @@ -1,7 +1,7 @@