fix: nostr discovery timeout
All checks were successful
Open PR on Staging / audit_and_check (pull_request) Successful in 34s

This commit is contained in:
enes 2024-09-20 17:35:19 +02:00
parent 9432e99b3b
commit 3a090cdfd6

View File

@ -790,11 +790,21 @@ const getUserAppDataFromBlossom = async (url: string, privateKey: string) => {
errorCode = status
}
// HACK: Timeout issue, blossom server nostr discovery
// Force the error code as the timeout
if (
errorCode === 0 &&
axios.isAxiosError(err) &&
err.code === 'ERR_NETWORK'
) {
errorCode = 504
}
return null
})
// Return a default value if the requested resource is not found (404)
if (errorCode === 404) {
if (errorCode === 404 || errorCode === 504) {
return {
sigits: {},
processedGiftWraps: []