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 Key = require('../key')
|
||||||
const Utils = require('../utils')
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {string} pub
|
* @param {string} pub
|
||||||
* @returns {Promise<string>}
|
* @returns {Promise<string>}
|
||||||
*/
|
*/
|
||||||
exports.currentOrderAddress = async pub => {
|
exports.currentOrderAddress = async pub => {
|
||||||
const currAddr = await Utils.tryAndWait(gun =>
|
const currAddr = await require('../../Mediator')
|
||||||
gun
|
.getGun()
|
||||||
.user(pub)
|
.user(pub)
|
||||||
.get(Key.CURRENT_ORDER_ADDRESS)
|
.get(Key.CURRENT_ORDER_ADDRESS)
|
||||||
.then()
|
.specialThen()
|
||||||
)
|
|
||||||
|
|
||||||
if (typeof currAddr !== 'string') {
|
if (typeof currAddr !== 'string') {
|
||||||
throw new TypeError('Expected user.currentOrderAddress to be an string')
|
throw new TypeError('Expected user.currentOrderAddress to be an string')
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue