Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent borrower from Locking NFT that is not in his wallet #326

Merged
merged 4 commits into from
Aug 13, 2021

Conversation

onnovisser
Copy link
Collaborator

Disabled the Lock NFT button when the owner of the NFT isn't the connected address.
Also fixes the error messages that were not being displayed.

Closes #67

@github-actions
Copy link

🚀 Deployed on https://pr-326--dev-tinlake.netlify.app

@onnovisser onnovisser requested a review from hieronx August 12, 2021 10:26
Copy link
Contributor

@hieronx hieronx left a comment

Choose a reason for hiding this comment

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

Nice!

let nftData: any
let maturityDate: number = 0

try {
nftOwner = (await tinlake.getOwnerOfCollateral(registry, tokenId)).toString()
} catch (e) {
return loggedError(e, 'Could not get NFT owner for NFT ID', tokenId)
if (e.message.match(/invalid address/i)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This is great 🙌

@onnovisser onnovisser merged commit 4c5b820 into main Aug 13, 2021
@onnovisser onnovisser deleted the lock-nft-error-messages branch August 13, 2021 07:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Prevent borrower from Locking NFT that is not in his wallet
2 participants