Skip to content

Commit aedaf3d

Browse files
committed
finish primary secondary
1 parent 00efcd5 commit aedaf3d

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

src/pages/display/index.js

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,8 @@ export default class Display extends Component {
372372
collectionType: 'notForSale'
373373
})
374374

375+
this.reset()
376+
375377
let list = await getRestrictedAddresses()
376378
// console.log(this.state.wallet)
377379
// console.log(!list.includes(this.state.wallet))
@@ -402,7 +404,6 @@ export default class Display extends Component {
402404
})
403405

404406
this.setState({ items: this.state.objkts.slice(0, 15), offset: 15 })
405-
this.filterCreationsForSale()
406407
}
407408

408409
filterCreationsNotForSale = async () => {
@@ -424,16 +425,24 @@ export default class Display extends Component {
424425

425426
this.setState({ marketV1: v1Swaps, loading: false })
426427

428+
console.log("hello")
429+
430+
console.log("the creations" + this.state.creations.length)
431+
console.log("the objkts" + this.state.objkts.length)
432+
433+
this.setState({ objkts: this.state.creations, loading: false, items: [] })
434+
435+
console.log("the creations" + this.state.creations.length)
436+
console.log("the objkts" + this.state.objkts.length)
437+
427438
if (forSaleType !== null) {
428439
if (forSaleType == 0) {
429440
this.setState({
430-
objkts: await this.filterCreationsForSalePrimary(this.state.objkts),
431-
items: []
441+
objkts: await this.filterCreationsForSalePrimary(this.state.objkts)
432442
})
433443
} else if (forSaleType == 1) {
434444
this.setState({
435-
objkts: await this.filterCreationsForSaleSecondary(this.state.objkts),
436-
items: []
445+
objkts: await this.filterCreationsForSaleSecondary(this.state.objkts)
437446
})
438447
}
439448
} else {
@@ -457,7 +466,7 @@ export default class Display extends Component {
457466
filterCreationsForSaleSecondary = async () => {
458467
let objkts = this.state.creations.filter(item => {
459468
const swaps = item.swaps.filter(swaps => {
460-
return swaps.status == 0
469+
return swaps.status == 0 && swaps.creator_id !== this.state.wallet
461470
})
462471
return swaps && swaps.length > 0
463472
});

0 commit comments

Comments
 (0)