From 62c833862bcce46f0e33730e736de8f9a1058ccb Mon Sep 17 00:00:00 2001 From: Daniel Lugo Date: Fri, 8 Oct 2021 14:56:42 -0400 Subject: [PATCH] Use specialThen() here --- services/gunDB/contact-api/getters/index.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/services/gunDB/contact-api/getters/index.js b/services/gunDB/contact-api/getters/index.js index d5e198b6..2f2d9944 100644 --- a/services/gunDB/contact-api/getters/index.js +++ b/services/gunDB/contact-api/getters/index.js @@ -3,19 +3,17 @@ */ const Key = require('../key') -const Utils = require('../utils') /** * @param {string} pub * @returns {Promise} */ exports.currentOrderAddress = async pub => { - const currAddr = await Utils.tryAndWait(gun => - gun - .user(pub) - .get(Key.CURRENT_ORDER_ADDRESS) - .then() - ) + const currAddr = await require('../../Mediator') + .getGun() + .user(pub) + .get(Key.CURRENT_ORDER_ADDRESS) + .specialThen() if (typeof currAddr !== 'string') { throw new TypeError('Expected user.currentOrderAddress to be an string')