From 824a7c2feb5a7d51605ee0797fea6b8eb6d4d7d2 Mon Sep 17 00:00:00 2001 From: alexcos20 Date: Wed, 21 Oct 2020 07:57:00 -0700 Subject: [PATCH] add sleep --- src/hooks/usePublish/usePublish.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/hooks/usePublish/usePublish.ts b/src/hooks/usePublish/usePublish.ts index fbd5055..dd4d992 100644 --- a/src/hooks/usePublish/usePublish.ts +++ b/src/hooks/usePublish/usePublish.ts @@ -35,6 +35,11 @@ function usePublish(): UsePublish { setPublishStep(index) index && setPublishStepText(publishFeedback[index]) } + function sleep(ms: number) { + return new Promise((resolve) => { + setTimeout(resolve, ms) + }) + } /** * Publish an asset.It also creates the datatoken, mints tokens and gives the market allowance * @param {Metadata} asset The metadata of the asset. @@ -141,6 +146,7 @@ function usePublish(): UsePublish { ) .next(setStep) Logger.log('ddo created', ddo) + await sleep(20000) setStep(7) return ddo } catch (error) {