Use specialThen() here

This commit is contained in:
Daniel Lugo 2021-10-08 14:56:42 -04:00
parent 6aa0c2b959
commit 62c833862b

View file

@ -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')