should work in theory?

This commit is contained in:
ingawei 2022-09-14 01:06:03 -07:00
parent 273b815e54
commit aee68936d2
2 changed files with 8 additions and 5 deletions

View File

@ -14,7 +14,8 @@ service cloud.firestore {
'manticmarkets@gmail.com',
'iansphilips@gmail.com',
'd4vidchee@gmail.com',
'federicoruizcassarino@gmail.com'
'federicoruizcassarino@gmail.com',
'ingawei@gmail.com'
]
}

View File

@ -45,6 +45,7 @@ import {
import { ContractsGrid } from 'web/components/contract/contracts-grid'
import { Title } from 'web/components/title'
import { usePrefetch } from 'web/hooks/use-prefetch'
import { useAdmin } from 'web/hooks/use-admin'
export const getStaticProps = fromPropz(getStaticPropz)
export async function getStaticPropz(props: {
@ -116,13 +117,16 @@ export function ContractPageSidebar(props: {
}) {
const { contract, user } = props
const { creatorId, isResolved, outcomeType } = contract
const isCreator = user?.id === creatorId
const isBinary = outcomeType === 'BINARY'
const isPseudoNumeric = outcomeType === 'PSEUDO_NUMERIC'
const isNumeric = outcomeType === 'NUMERIC'
const allowTrade = tradingAllowed(contract)
const allowResolve = !isResolved && isCreator && !!user
// INGA HERE IT'S HERE THIS IS THE SOLUTION
// const allowResolve = !isResolved && isCreator && !!user
const isAdmin = useAdmin()
const allowResolve = !isResolved && (isCreator || isAdmin) && !!user
const hasSidePanel =
(isBinary || isNumeric || isPseudoNumeric) && (allowTrade || allowResolve)
@ -154,10 +158,8 @@ export function ContractPageContent(
}
) {
const { backToHome, comments, user } = props
const contract = useContractWithPreload(props.contract) ?? props.contract
usePrefetch(user?.id)
useTracking(
'view market',
{