diff --git a/api/resolvers/price.js b/api/resolvers/price.js
index 2baedfc7..c04e7df9 100644
--- a/api/resolvers/price.js
+++ b/api/resolvers/price.js
@@ -21,15 +21,16 @@ async function getPrice (fiat) {
const expired = createdAt + expiresIn < Date.now()
if (expired) fetchPrice(fiat).catch(console.error) // update cache
return price // serve stale price (this on the SSR critical path)
+ } else {
+ fetchPrice(fiat).catch(console.error)
}
- return await fetchPrice(fiat)
+ return null
}
export default {
Query: {
price: async (parent, { fiatCurrency }, ctx) => {
- const price = await getPrice(fiatCurrency)
- return price
+ return await getPrice(fiatCurrency)
}
}
}
diff --git a/components/bounty-form.js b/components/bounty-form.js
index f43a8616..4ada054e 100644
--- a/components/bounty-form.js
+++ b/components/bounty-form.js
@@ -7,6 +7,7 @@ import AdvPostForm, { AdvPostInitial } from './adv-post-form'
import FeeButton, { EditFeeButton } from './fee-button'
import { InputGroup } from 'react-bootstrap'
import { bountySchema } from '../lib/validate'
+import { SubSelectInitial } from './sub-select-form'
export function BountyForm ({
item,
@@ -17,7 +18,8 @@ export function BountyForm ({
textLabel = 'text',
buttonText = 'post',
adv,
- handleSubmit
+ handleSubmit,
+ children
}) {
const router = useRouter()
const client = useApolloClient()
@@ -54,7 +56,8 @@ export function BountyForm ({
title: item?.title || '',
text: item?.text || '',
bounty: item?.bounty || 1000,
- ...AdvPostInitial({ forward: item?.fwdUser?.name })
+ ...AdvPostInitial({ forward: item?.fwdUser?.name }),
+ ...SubSelectInitial({ sub: item?.subName || sub?.name })
}}
schema={schema}
onSubmit={
@@ -83,6 +86,7 @@ export function BountyForm ({
}
storageKeyPrefix={item ? undefined : 'bounty'}
>
+ {children}
{
@@ -71,6 +73,7 @@ export function DiscussionForm ({
})}
storageKeyPrefix={item ? undefined : 'discussion'}
>
+ {children}