-
Notifications
You must be signed in to change notification settings - Fork 49
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
Accept transfer #310
Accept transfer #310
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@@ -18,14 +18,14 @@ const RequestSplit: NextPage = () => { | |||
const { connection } = useConnection() | |||
const anchorWallet = useAnchorWallet() | |||
|
|||
const [owner, setOwner] = useState<PublicKey>() | |||
const [recipient, setRecipient] = useState<PublicKey>() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename owner
to recipient
break | ||
} | ||
} | ||
} | ||
|
||
useEffect(() => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe use useStakeConnection hook here and in request.tsx too?
@@ -88,7 +88,7 @@ const RequestSplit: NextPage = () => { | |||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this comment refers to line 69
Can replace the useEffect hook with useStakeAccounts hook.
|
||
const ApproveSplit: NextPage = () => { | ||
const { connection } = useConnection() | ||
const anchorWallet = useAnchorWallet() | ||
const { publicKey, connected } = useWallet() | ||
const [amount, setAmount] = useState<PythBalance>() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can combine amount and recipient in an object. Since we are setting them always together.
Having an object result in one state update. Else, it will be multiple state updates. Imo is a good practice to have as less state update as possible.
Sorry I really need this PR right now, let me fix comments later |
Refactor accept transfer
Add feature to be compatible with someone having multiple accounts