avoid duplicate heeaders sent by handleError()

This commit is contained in:
Daniel Lugo 2020-11-06 13:03:22 -04:00
parent 0bd5fd0be5
commit a047dcf4e5

View file

@ -655,15 +655,20 @@ module.exports = async (
const user = require('../services/gunDB/Mediator').getUser()
const SEA = require('../services/gunDB/Mediator').mySEA
await Common.Utils.makePromise((res, rej) => {
lightning.exportAllChannelBackups({}, (err, channelBackups) => {
if (err) {
return handleError(res, err)
return rej(new Error(err.details))
}
res(
GunActions.saveChannelsBackup(
JSON.stringify(channelBackups),
user,
SEA
)
)
})
})
// Send an event to update lightning's status