Skip to content

Commit

Permalink
chore: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
khanti42 committed Feb 12, 2025
1 parent 8bad9a5 commit aedc49b
Showing 1 changed file with 13 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useState, useEffect, useCallback } from 'react';
import { useState, useEffect } from 'react';
import { useAppSelector } from 'hooks/redux';
import { useMultiLanguage, useStarkNetSnap } from 'services';
import { InputWithLabel } from 'components/ui/molecule/InputWithLabel';
Expand Down Expand Up @@ -30,18 +30,19 @@ export const AddAccountModalView = ({ closeModal }: Props) => {
accountName: '',
});

const fetchNextIndex = useCallback(async () => {
try {
const response = await getNextAccountIndex(chainId);
setFields({ accountName: `Account ${response.addressIndex + 1}` });
} catch (error) {
console.error('Failed to fetch next account index:', error);
}
}, [chainId, setFields]);

useEffect(() => {
fetchNextIndex();
}, [fetchNextIndex]);
const fetchNextIndex = async () => {
try {
const response = await getNextAccountIndex(chainId);
setFields({ accountName: `Account ${response.addressIndex + 1}` });
} catch (error) {
console.error('Failed to fetch next account index:', error);
}
};
if (fields.accountName === '') {
fetchNextIndex();
}
});

const handleChange = (fieldName: string, fieldValue: string) => {
setFields((prevFields) => ({
Expand Down

0 comments on commit aedc49b

Please sign in to comment.