Skip to content

Commit

Permalink
Gallery useTabs: using useAsyncFn instead of useCallback
Browse files Browse the repository at this point in the history
  • Loading branch information
hide-on-bush-x committed Aug 23, 2023
1 parent 6102813 commit cf39003
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/refactor/ui/components/modals/gallery/useTabs.tsx
@@ -1,5 +1,6 @@
import { BigNumber } from 'ethers';
import React, { useCallback, useEffect, useState } from 'react';
import React, { useEffect, useState } from 'react';
import { useAsyncFn } from 'react-use';
import {
GalleryMetadata,
TabsInterface,
Expand Down Expand Up @@ -31,7 +32,7 @@ export const useTabs = () => {

const [savedTabs, setSavedTabs] = useState<TabsInterface[]>();

const getTabs = useCallback(async () => {
const [, getTabs] = useAsyncFn(async () => {
if (!customSBTs || (customSBTs && customSBTs.length === 0)) return;

const newTabs: TabsInterface[] = [];
Expand Down

0 comments on commit cf39003

Please sign in to comment.