Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
Nick-1979 committed Jun 23, 2024
1 parent fe4f279 commit 8beb7ad
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ function ImportProxiedFS(): React.ReactElement {
setSelectedAddress(address);
}, []);

const createProxids = useCallback(() => {
return new Promise(async (resolve) => {
const createProxids = useCallback(async () => {
try {
for (let index = 0; index < selectedProxied.length; index++) {
const address = selectedProxied[index];
const randomName = (chance?.name() as string)?.split(' ')?.[0] || `Proxied ${index + 1}`;
Expand All @@ -91,8 +91,11 @@ function ImportProxiedFS(): React.ReactElement {
await updateMeta(address, metaData);
}
}
resolve(true);
})
return true;
} catch (error) {
console.error('Failed to create proxied accounts:', error);
return false;
}
}, [chain?.genesisHash, chance, selectedProxied, profileName]);

const onImport = useCallback(() => {
Expand Down

0 comments on commit 8beb7ad

Please sign in to comment.