Skip to content

Commit

Permalink
Add pool name to tranche name if user does not modify the tranches
Browse files Browse the repository at this point in the history
  • Loading branch information
kattylucy committed Jun 28, 2024
1 parent 987d5ca commit c52db63
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion centrifuge-app/src/pages/IssuerCreatePool/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ const initialValues: CreatePoolValues = {
reportAuthorAvatar: null,
reportUrl: '',

tranches: [createEmptyTranche('Junior')],
tranches: [createEmptyTranche('')],
adminMultisig: {
signers: [],
threshold: 1,
Expand Down Expand Up @@ -543,6 +543,13 @@ function CreatePoolForm() {
value: label,
})) ?? []

// Use useEffect to update tranche name when poolName changes
React.useEffect(() => {
if (form.values.poolName) {
form.setFieldValue('tranches', [createEmptyTranche(form.values.poolName)])
}
}, [form.values.poolName])

return (
<>
<PreimageHashDialog
Expand Down

0 comments on commit c52db63

Please sign in to comment.