Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 9d2d271c20 | |||
| c0456a3bf6 |
@@ -1,5 +1,12 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## [0.20.2](https://github.com/ethersphere/bee-dashboard/compare/v0.20.1...v0.20.2) (2022-09-15)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* stamp purchasing ([#551](https://github.com/ethersphere/bee-dashboard/issues/551)) ([c0456a3](https://github.com/ethersphere/bee-dashboard/commit/c0456a3bf6d541457b706670b1a757d2b1d70f10))
|
||||||
|
|
||||||
## [0.20.1](https://github.com/ethersphere/bee-dashboard/compare/v0.20.0...v0.20.1) (2022-09-15)
|
## [0.20.1](https://github.com/ethersphere/bee-dashboard/compare/v0.20.0...v0.20.1) (2022-09-15)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Generated
+2
-2
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "@ethersphere/bee-dashboard",
|
"name": "@ethersphere/bee-dashboard",
|
||||||
"version": "0.20.1",
|
"version": "0.20.2",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "@ethersphere/bee-dashboard",
|
"name": "@ethersphere/bee-dashboard",
|
||||||
"version": "0.20.1",
|
"version": "0.20.2",
|
||||||
"license": "BSD-3-Clause",
|
"license": "BSD-3-Clause",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@ethersphere/bee-js": "^5.0.0",
|
"@ethersphere/bee-js": "^5.0.0",
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@ethersphere/bee-dashboard",
|
"name": "@ethersphere/bee-dashboard",
|
||||||
"version": "0.20.1",
|
"version": "0.20.2",
|
||||||
"description": "An app which helps users to setup their Bee node and do actions like cash out cheques",
|
"description": "An app which helps users to setup their Bee node and do actions like cash out cheques",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"bee",
|
"bee",
|
||||||
|
|||||||
+12
-4
@@ -1,4 +1,4 @@
|
|||||||
import { BatchId, BeeDebug, PostageBatch } from '@ethersphere/bee-js'
|
import { BatchId, BeeDebug, BeeResponseError, PostageBatch } from '@ethersphere/bee-js'
|
||||||
import { decodeCid } from '@ethersphere/swarm-cid'
|
import { decodeCid } from '@ethersphere/swarm-cid'
|
||||||
import { BigNumber } from 'bignumber.js'
|
import { BigNumber } from 'bignumber.js'
|
||||||
import { BZZ_LINK_DOMAIN } from '../constants'
|
import { BZZ_LINK_DOMAIN } from '../constants'
|
||||||
@@ -229,7 +229,7 @@ export function shortenText(text: string, length = 20, separator = '[…]'): str
|
|||||||
}
|
}
|
||||||
|
|
||||||
const DEFAULT_POLLING_FREQUENCY = 1_000
|
const DEFAULT_POLLING_FREQUENCY = 1_000
|
||||||
const DEFAULT_STAMP_USABLE_TIMEOUT = 240_000
|
const DEFAULT_STAMP_USABLE_TIMEOUT = 5 * 60_000
|
||||||
|
|
||||||
interface Options {
|
interface Options {
|
||||||
pollingFrequency?: number
|
pollingFrequency?: number
|
||||||
@@ -254,9 +254,17 @@ async function waitForStamp(
|
|||||||
const pollingFrequency = options?.pollingFrequency || DEFAULT_POLLING_FREQUENCY
|
const pollingFrequency = options?.pollingFrequency || DEFAULT_POLLING_FREQUENCY
|
||||||
|
|
||||||
for (let i = 0; i < timeout; i += pollingFrequency) {
|
for (let i = 0; i < timeout; i += pollingFrequency) {
|
||||||
const stamp = await beeDebug.getPostageBatch(batchId)
|
try {
|
||||||
|
const stamp = await beeDebug.getPostageBatch(batchId)
|
||||||
|
|
||||||
|
if (stamp[field]) return stamp
|
||||||
|
} catch (e) {
|
||||||
|
// TODO: Workaround for https://github.com/ethersphere/bee/issues/3300
|
||||||
|
if ((e as BeeResponseError).message !== 'Bad Request: cannot get batch') {
|
||||||
|
throw e
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (stamp[field]) return stamp
|
|
||||||
await sleepMs(pollingFrequency)
|
await sleepMs(pollingFrequency)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user