Целевая страница отсканированного QR-кода (пока без реальной отправки сообщения)
Main daploy / deploy (push) Successful in 37s

This commit is contained in:
2024-11-19 00:13:49 +02:00
parent fe4317982f
commit 1a11efe25d
10 changed files with 161 additions and 32 deletions
+10 -2
View File
@@ -43,5 +43,13 @@ export const createQrCodeDocument = async (
return qrCodeDoc
}
export const getQrCodeDocument = (uri: string) =>
qrCodeDbLocal.get<QRCodeDocument>(`qr_code:${uri}`)
export const getQrCodeDocument = (uri: string) => {
try {
return qrCodeDbLocal.get<QRCodeDocument>(`qr_code:${uri}`)
} catch (e) {
if ((e as { code: string }).code === 'not_found') {
return qrCodeDbRemote.get<QRCodeDocument>(`qr_code:${uri}`)
}
throw e
}
}