use ===
This commit is contained in:
parent
cc03e4acbc
commit
753c4daba8
1 changed files with 6 additions and 6 deletions
|
|
@ -1170,15 +1170,15 @@ const saveSeedBackup = async (mnemonicPhrase, user, SEA) => {
|
|||
* @param {ISEA} SEA
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
const saveChannelsBackup = async (backups,user,SEA) => {
|
||||
if (backups == '') {
|
||||
const saveChannelsBackup = async (backups, user, SEA) => {
|
||||
if (backups === '') {
|
||||
throw new TypeError('cant save an empty channel backup')
|
||||
}
|
||||
const mySecret = require('../Mediator').getMySecret()
|
||||
const encryptBackups = await SEA.encrypt(backups,mySecret)
|
||||
return new Promise((res,rej) => {
|
||||
user.get(Key.CHANNELS_BACKUP).put(encryptBackups,ack => {
|
||||
if(ack.err) {
|
||||
const encryptBackups = await SEA.encrypt(backups, mySecret)
|
||||
return new Promise((res, rej) => {
|
||||
user.get(Key.CHANNELS_BACKUP).put(encryptBackups, ack => {
|
||||
if (ack.err) {
|
||||
rej(ack.err)
|
||||
} else {
|
||||
res()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue