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