Skip to content

Commit

Permalink
Bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
kattylucy committed Dec 12, 2024
1 parent bd65c97 commit ee0c6d8
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ export const TransactionHistoryTable = ({
View all
</AnchorButton>
)}
{transactions?.length && (
{transactions?.length ? (
<AnchorButton
href={csvUrl}
download={`pool-transaction-history-${poolId}.csv`}
Expand All @@ -304,7 +304,7 @@ export const TransactionHistoryTable = ({
>
Download
</AnchorButton>
)}
) : null}
</Shelf>
</Shelf>
<Box overflow="auto">
Expand Down
17 changes: 13 additions & 4 deletions centrifuge-app/src/pages/IssuerCreatePool/PoolSetupSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,6 @@ export const PoolSetupSection = () => {
form.setFieldValue('adminMultisig.signers[0]', selectedAccount?.address)
}, [])

Check warning on line 65 in centrifuge-app/src/pages/IssuerCreatePool/PoolSetupSection.tsx

View workflow job for this annotation

GitHub Actions / build-app

React Hook useEffect has missing dependencies: 'form' and 'selectedAccount?.address'. Either include them or remove the dependency array

Check warning on line 65 in centrifuge-app/src/pages/IssuerCreatePool/PoolSetupSection.tsx

View workflow job for this annotation

GitHub Actions / ff-prod / build-app

React Hook useEffect has missing dependencies: 'form' and 'selectedAccount?.address'. Either include them or remove the dependency array

console.log(values)

return (
<Box>
<Text variant="heading2" fontWeight={700}>
Expand All @@ -89,6 +87,7 @@ export const PoolSetupSection = () => {
form.setFieldValue('adminMultisigEnabled', false)
}}
isChecked={!values.adminMultisigEnabled}
id="singleMultisign"
/>
<CheckboxOption
height={40}
Expand All @@ -100,6 +99,7 @@ export const PoolSetupSection = () => {
form.setFieldValue('adminMultisig.signers', [form.values.adminMultisig.signers[0], ''])
}}
isChecked={values.adminMultisigEnabled}
id="multiMultisign"
/>
</Box>
<Box>
Expand Down Expand Up @@ -223,15 +223,24 @@ export const PoolSetupSection = () => {
{values.assetOriginators?.map((_: string, index: number) => (
<Box key={index} mt={2}>
<Field name={`assetOriginators.${index}`} validate={validate.addressValidate}>
{({ field, form, meta }: FieldProps) => (
{({ field, form }: FieldProps) => (
<Field
placeholder="Type address..."
{...field}
onChange={(val: React.ChangeEvent<HTMLInputElement>) => {
form.setFieldValue(`assetOriginators.${index}`, val.target.value)
}}
as={TextInput}
onBlur={field.onBlur}
onBlur={() => {
form.setFieldTouched(`assetOriginators.${index}`, true)
const value = form.values.assetOriginators[index]
if (value) {
const transformedValue = isEvmAddress(value)
? evmToSubstrateAddress(value, chainId ?? 0)
: value
form.setFieldValue(`assetOriginators.${index}`, transformedValue)
}
}}
/>
)}
</Field>
Expand Down
9 changes: 7 additions & 2 deletions centrifuge-app/src/pages/IssuerCreatePool/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ const IssuerCreatePoolPage = () => {
const [step, setStep] = useState(1)
const [stepCompleted, setStepCompleted] = useState({ 1: false, 2: false, 3: false })
const [multisigData, setMultisigData] = useState<{ hash: string; callData: string }>()
const [isMultisigDialogOpen, setIsMultisigDialogOpen] = useState(true)
const [isMultisigDialogOpen, setIsMultisigDialogOpen] = useState(false)
const [createdModal, setCreatedModal] = useState(false)
const [preimageHash, setPreimageHash] = useState('')
const [isPreimageDialogOpen, setIsPreimageDialogOpen] = useState(false)
Expand Down Expand Up @@ -387,6 +387,11 @@ const IssuerCreatePoolPage = () => {
}
}

// Issuer categories
if (values.issuerCategories[0].value === '') {
metadataValues.issuerCategories = []
}

createProxies([
(aoProxy, adminProxy) => {
createPoolTx(
Expand Down Expand Up @@ -508,7 +513,7 @@ const IssuerCreatePoolPage = () => {
small
onClick={handleNextStep}
loading={createProxiesIsPending || transactionIsPending || form.isSubmitting}
disabled={step === 3}
disabled={step === 3 ? !(Object.keys(errors).length === 0) : false}
>
{step === 3 ? 'Create pool' : 'Next'}
</Button>
Expand Down

0 comments on commit ee0c6d8

Please sign in to comment.