fix: remove expired stamps (#463)

* fix: increase waitUntilStampUsable timeout

* fix: wait for stamp to exist after buying
This commit is contained in:
Cafe137
2022-07-04 15:28:43 +02:00
committed by GitHub
parent d12f86b9fa
commit eb51dbb090
3 changed files with 26 additions and 10 deletions
+9 -2
View File
@@ -9,7 +9,13 @@ import { SwarmTextInput } from '../../components/SwarmTextInput'
import { Context as BeeContext } from '../../providers/Bee'
import { Context as SettingsContext } from '../../providers/Settings'
import { Context as StampsContext } from '../../providers/Stamps'
import { calculateStampPrice, convertAmountToSeconds, convertDepthToBytes, secondsToTimeString } from '../../utils'
import {
calculateStampPrice,
convertAmountToSeconds,
convertDepthToBytes,
secondsToTimeString,
waitUntilStampExists,
} from '../../utils'
import { getHumanReadableFileSize } from '../../utils/file'
interface FormValues {
@@ -97,7 +103,8 @@ export function PostageStampCreation({ onFinished }: Props): ReactElement {
const amount = BigInt(values.amount)
const depth = Number.parseInt(values.depth)
const options = values.label ? { label: values.label } : undefined
await beeDebugApi.createPostageBatch(amount.toString(), depth, options)
const batchId = await beeDebugApi.createPostageBatch(amount.toString(), depth, options)
await waitUntilStampExists(batchId, beeDebugApi)
actions.resetForm()
await refresh()
onFinished()