Skip to content

Commit

Permalink
undefined? creator fix
Browse files Browse the repository at this point in the history
  • Loading branch information
crzypatchwork committed Sep 22, 2021
1 parent 4df8a91 commit 4746ce3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 15 deletions.
8 changes: 4 additions & 4 deletions src/components/item-info/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,13 +172,13 @@ export const ItemInfo = ({
<div className={styles.inline}>
<Button
to={
`/tz/${creator.address}`
`/tz/${creator?.address}`
}
>
{creator.name ? (
<Primary>{encodeURI(creator.name)}</Primary>
{creator?.name ? (
<Primary>{encodeURI(creator?.name)}</Primary>
) : (
<Primary>{walletPreview(creator.address)}</Primary>
<Primary>{walletPreview(creator?.address)}</Primary>
)}
</Button>
</div>
Expand Down
9 changes: 1 addition & 8 deletions src/components/owner-list/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ export const OwnerList = ({ owners, creator_id, acc, swaps }) => {
))}
{
swaps.map((e, index) => {
if (acc) {
if (acc && !acc.address == e.creator_id) {

return (
<div>
<div key={`${e.id}-${index}`} className={styles.swap}>
Expand All @@ -48,12 +47,6 @@ export const OwnerList = ({ owners, creator_id, acc, swaps }) => {
</div>
</div>
)
} else {
return undefined
}
} else {
return undefined
}
})
}
</div>
Expand Down
6 changes: 3 additions & 3 deletions src/pages/objkt-display/tabs/swap.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { Loading } from '../../../components/loading'
import { Input } from '../../../components/input'
import { Button, Curate, Purchase } from '../../../components/button'
import { stubFalse } from 'lodash'
export const Swap = ({ total_amount, owners, creator, royalties, token_info, address }) => {
export const Swap = ({ total_amount, owners, creator, royalties, token_info, address, restricted }) => {
const { id } = useParams()
const { swap, swapv2, acc, swap_hDAO, progress, setProgress, message, setMessage } = useContext(HicetnuncContext)
const [amount, setAmount] = useState()
Expand Down Expand Up @@ -47,8 +47,8 @@ export const Swap = ({ total_amount, owners, creator, royalties, token_info, add
console.log(acc.address, royalties, parseFloat(price) * 1000000, id, creator.address, parseFloat(amount))

if (currency === 'tez') {
swapv2(acc.address, royalties, parseFloat(price) * 1000000, id, creator.address, parseFloat(amount))
//swap(parseFloat(amount), id, parseFloat(price) * 1000000)
//swapv2(acc.address, royalties, parseFloat(price) * 1000000, id, creator.address, parseFloat(amount))
swap(parseFloat(amount), id, parseFloat(price) * 1000000)
.then((e) => {
// when taquito returns a success/fail message
//setProgress(false)
Expand Down

1 comment on commit 4746ce3

@tortulez
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That one doesn't look good !

Please sign in to comment.