Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ export const ATPDetailsModal = ({ atp, isOpen, onClose, onWithdrawSuccess, onRef
Error: Staker contract address not found
</div>
</div>
) : !rollupVersion ? (
) : rollupVersion === undefined ? (
<div className="bg-parchment/5 border border-parchment/20 p-4 text-center">
<div className="text-sm text-parchment/60">
Loading stake details...
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@
const { formData, handlePrevStep } = useATPStakingStepsContext<ValidatorRegistrationForm>()
const { selectedAtp, uploadedKeystores, transactionType } = formData
const { activationThreshold, version: rollupVersion, isLoading: isLoadingRollup } = useRollupData()
const { symbol, decimals, isLoading: isLoadingToken } = useERC20TokenDetails(selectedAtp?.token!)

Check failure on line 33 in staking-dashboard/src/components/Registration/RegistrationStake.tsx

View workflow job for this annotation

GitHub Actions / Build staking dashboard frontend

Optional chain expressions can return undefined by design - using a non-null assertion is unsafe and wrong
const { addTransaction, checkTransactionInQueue, isSafe, openCart } = useTransactionCart()
const { showAlert } = useAlert()
const [moveWithLatestRollup] = useState<boolean>(true)
const [showSuccessAlert, setShowSuccessAlert] = useState(false)
const atpDetailsRef = useRef<StakeFlowSelectedAtpDetailsRef>(null)

const stakeHook = useStake(selectedAtp?.staker!)

Check failure on line 40 in staking-dashboard/src/components/Registration/RegistrationStake.tsx

View workflow job for this annotation

GitHub Actions / Build staking dashboard frontend

Optional chain expressions can return undefined by design - using a non-null assertion is unsafe and wrong

const totalStakeAmount = activationThreshold && uploadedKeystores.length > 0
? activationThreshold * BigInt(uploadedKeystores.length)
Expand Down Expand Up @@ -116,7 +116,7 @@

const handleAddValidatorToQueue = (index: number) => {
const keystore = uploadedKeystores[index]
if (!rollupVersion === undefined || !selectedAtp || !activationThreshold || completedValidatorsWithQueue.has(keystore.attester)) return
if (rollupVersion === undefined || !selectedAtp || !activationThreshold || completedValidatorsWithQueue.has(keystore.attester)) return

const transaction = buildValidatorTransaction(keystore)
if (!transaction) return
Expand Down Expand Up @@ -144,7 +144,7 @@
}

const handleAddAllToQueue = () => {
if (!selectedAtp || !rollupVersion === undefined || uploadedKeystores.length === 0) return
if (!selectedAtp || rollupVersion === undefined || uploadedKeystores.length === 0) return
if (!areAllKeystoresValid) {
showAlert('error', 'Invalid keystores detected')
return
Expand Down
Loading