timeout for getter
This commit is contained in:
parent
a72f6dd091
commit
c3fff0a432
2 changed files with 4 additions and 4 deletions
|
|
@ -868,7 +868,7 @@ const sendPayment = async (to, amount, memo, gun, user, SEA) => {
|
||||||
timestamp: Date.now()
|
timestamp: Date.now()
|
||||||
}
|
}
|
||||||
|
|
||||||
const currOrderAddress = await Getters.currentOrderAddress(to, gun)
|
const currOrderAddress = await Getters.currentOrderAddress(to)
|
||||||
|
|
||||||
order.timestamp = Date.now()
|
order.timestamp = Date.now()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,12 @@
|
||||||
const Key = require('./key')
|
const Key = require('./key')
|
||||||
|
const Utils = require('./utils')
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {string} pub
|
* @param {string} pub
|
||||||
* @param {import('./SimpleGUN').GUNNode} gun
|
|
||||||
* @returns {Promise<string>}
|
* @returns {Promise<string>}
|
||||||
*/
|
*/
|
||||||
exports.currentOrderAddress = async (pub, gun) => {
|
exports.currentOrderAddress = async (pub) => {
|
||||||
const currAddr = await gun.user(pub).get(Key.CURRENT_ORDER_ADDRESS).then()
|
const currAddr = await Utils.tryAndWait((gun) => gun.user(pub).get(Key.CURRENT_ORDER_ADDRESS).then())
|
||||||
|
|
||||||
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