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 user = require('../services/gunDB/Mediator').getUser()
const SEA = require('../services/gunDB/Mediator').mySEA const SEA = require('../services/gunDB/Mediator').mySEA
lightning.exportAllChannelBackups({}, (err, channelBackups) => { await Common.Utils.makePromise((res, rej) => {
if (err) { lightning.exportAllChannelBackups({}, (err, channelBackups) => {
return handleError(res, err) if (err) {
} return rej(new Error(err.details))
GunActions.saveChannelsBackup( }
JSON.stringify(channelBackups),
user, res(
SEA GunActions.saveChannelsBackup(
) JSON.stringify(channelBackups),
user,
SEA
)
)
})
}) })
// Send an event to update lightning's status // Send an event to update lightning's status