Compare commits

..

No commits in common. "33ed372236c412c0e96ba291c1b83b77877d8cd0" and "a99c16a3a7aa130f5792664d8f5216a5dd919c25" have entirely different histories.

2 changed files with 5 additions and 24 deletions

View File

@ -214,22 +214,8 @@ export class NostrController extends EventEmitter {
} }
}) })
if (publishedRelays.length === 0) { if (publishedRelays.length === 0)
const failedPublishes: any[] = [] throw new Error(`Couldn't publish to any relay`)
results.forEach((res, index) => {
if (res.status === 'rejected') {
failedPublishes.push(
{
relay: relays[index],
error: res.reason.message
}
)
}
})
throw failedPublishes
}
return publishedRelays return publishedRelays
} }

View File

@ -161,14 +161,9 @@ export const sendDM = async (
.then((relays) => { .then((relays) => {
toast.success(`Encrypted DM sent on: ${relays.join('\n')}`) toast.success(`Encrypted DM sent on: ${relays.join('\n')}`)
}) })
.catch((errResults) => { .catch((err) => {
console.log('err :>> ', errResults) console.log('err :>> ', err)
toast.error('An error occurred while publishing DM') toast.error(err.message || 'An error occurred while publishing DM')
errResults.forEach((errResult: any) => {
toast.error(`Publishing to ${errResult.relay} caused the following error: ${errResult.error}`)
})
return null return null
}) })
} }