Use specialThen() here
This commit is contained in:
parent
6aa0c2b959
commit
62c833862b
1 changed files with 5 additions and 7 deletions
|
|
@ -3,19 +3,17 @@
|
|||
*/
|
||||
|
||||
const Key = require('../key')
|
||||
const Utils = require('../utils')
|
||||
|
||||
/**
|
||||
* @param {string} pub
|
||||
* @returns {Promise<string>}
|
||||
*/
|
||||
exports.currentOrderAddress = async pub => {
|
||||
const currAddr = await Utils.tryAndWait(gun =>
|
||||
gun
|
||||
const currAddr = await require('../../Mediator')
|
||||
.getGun()
|
||||
.user(pub)
|
||||
.get(Key.CURRENT_ORDER_ADDRESS)
|
||||
.then()
|
||||
)
|
||||
.specialThen()
|
||||
|
||||
if (typeof currAddr !== 'string') {
|
||||
throw new TypeError('Expected user.currentOrderAddress to be an string')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue