Merge pull request #3421 from omnivore-app/fix/title

fix: do not throw error if title is undefined in cache
This commit is contained in:
Hongbo Wu 2024-01-23 19:33:22 +08:00 committed by GitHub
commit 47da6fb3dc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 17 deletions

View file

@ -58,16 +58,6 @@ interface CreateArticleResponse {
}
}
interface SavePageResponse {
data: {
savePage: {
url: string
clientRequestId: string
errorCodes?: string[]
}
}
}
interface FetchResult {
finalUrl: string
title?: string
@ -77,12 +67,7 @@ interface FetchResult {
}
const isFetchResult = (obj: unknown): obj is FetchResult => {
return (
typeof obj === 'object' &&
obj !== null &&
'finalUrl' in obj &&
'title' in obj
)
return typeof obj === 'object' && obj !== null && 'finalUrl' in obj
}
const uploadToSignedUrl = async (

View file

@ -5,7 +5,7 @@ export const createRedisClient = (url?: string, cert?: string) => {
connectTimeout: 10000, // 10 seconds
tls: cert
? {
cert,
cert: cert.replace(/\\n/g, '\n'), // replace \n with new line
rejectUnauthorized: false, // for self-signed certs
}
: undefined,