Fix build error
This commit is contained in:
parent
e2de954e5d
commit
1af1de859e
|
@ -249,9 +249,7 @@ function toActivityItem(bet: Bet) {
|
||||||
// - Do not have a comment
|
// - Do not have a comment
|
||||||
// - Were not created by this user
|
// - Were not created by this user
|
||||||
// Return a list of ActivityItems
|
// Return a list of ActivityItems
|
||||||
function group(bets: Bet[]) {
|
function group(bets: Bet[], userId?: string) {
|
||||||
const user = useUser()
|
|
||||||
|
|
||||||
const items: any[] = []
|
const items: any[] = []
|
||||||
let group: Bet[] = []
|
let group: Bet[] = []
|
||||||
|
|
||||||
|
@ -266,7 +264,7 @@ function group(bets: Bet[]) {
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const bet of bets) {
|
for (const bet of bets) {
|
||||||
const isCreator = user?.id === bet.userId
|
const isCreator = userId === bet.userId
|
||||||
|
|
||||||
if (bet.comment || isCreator) {
|
if (bet.comment || isCreator) {
|
||||||
pushGroup()
|
pushGroup()
|
||||||
|
@ -346,11 +344,12 @@ type ActivityItem = {
|
||||||
export function ContractFeed(props: { contract: Contract }) {
|
export function ContractFeed(props: { contract: Contract }) {
|
||||||
const { contract } = props
|
const { contract } = props
|
||||||
const { id } = contract
|
const { id } = contract
|
||||||
|
const user = useUser()
|
||||||
|
|
||||||
let bets = useBets(id)
|
let bets = useBets(id)
|
||||||
if (bets === 'loading') bets = []
|
if (bets === 'loading') bets = []
|
||||||
|
|
||||||
const allItems = [{ type: 'start', id: 0 }, ...group(bets)]
|
const allItems = [{ type: 'start', id: 0 }, ...group(bets, user?.id)]
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="flow-root">
|
<div className="flow-root">
|
||||||
|
|
Loading…
Reference in New Issue
Block a user