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) {
const failedPublishes: any[] = []
results.forEach((res, index) => {
if (res.status === 'rejected') {
failedPublishes.push(
{
relay: relays[index],
error: res.reason.message
}
)
}
})
throw failedPublishes
}
if (publishedRelays.length === 0)
throw new Error(`Couldn't publish to any relay`)
return publishedRelays
}

View File

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