From e504877555e986fd84db69ea8b1e90bf721dba81 Mon Sep 17 00:00:00 2001 From: naturexie <786281870@qq.com> Date: Thu, 30 Jan 2025 23:56:43 +0800 Subject: [PATCH] feat: liquidations assets logic --- screens/Dashboard/liquidations.tsx | 10 +++++----- screens/Dashboard/records.tsx | 11 +++++------ 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/screens/Dashboard/liquidations.tsx b/screens/Dashboard/liquidations.tsx index d90617ce..2571678b 100644 --- a/screens/Dashboard/liquidations.tsx +++ b/screens/Dashboard/liquidations.tsx @@ -11,12 +11,8 @@ import { setUnreadLiquidation } from "../../redux/appSlice"; import { getAccountId } from "../../redux/accountSelectors"; const Liquidations = ({ isShow, setLiquidationPage }) => { - const dispatch = useAppDispatch(); - const assets = useAppSelector(getAssetsCategory()); - const accountId = useAppSelector(getAccountId); - const [isLoading, setIsLoading] = useState(false); const [docs, setDocs] = useState([]); - const isMeme = useAppSelector(isMemeCategory); + const [isLoading, setIsLoading] = useState(false); const [pagination, setPagination] = useState<{ page?: number; totalPages?: number; @@ -24,6 +20,10 @@ const Liquidations = ({ isShow, setLiquidationPage }) => { }>({ page: 1, }); + const dispatch = useAppDispatch(); + const isMeme = useAppSelector(isMemeCategory); + const assets = useAppSelector(getAssetsCategory(isMeme)); + const accountId = useAppSelector(getAccountId); useEffect(() => { if (isShow) { fetchData({ diff --git a/screens/Dashboard/records.tsx b/screens/Dashboard/records.tsx index 6ed4c465..67443665 100644 --- a/screens/Dashboard/records.tsx +++ b/screens/Dashboard/records.tsx @@ -17,12 +17,6 @@ import { } from "../../components/Icons/Icons"; const Records = ({ isShow }) => { - const accountId = useAccountId(); - const { activeCategory } = useAppSelector((state) => state.category); - const { toastMessage, showToast } = useToastMessage(); - const isMeme = useAppSelector(isMemeCategory); - const assets = useAppSelector(getAssetsCategory(isMeme)); - const [isLoading, setIsLoading] = useState(false); const [docs, setDocs] = useState([]); const [pagination, setPagination] = useState<{ page?: number; @@ -32,6 +26,11 @@ const Records = ({ isShow }) => { page: 1, }); const [txLoadingStates, setTxLoadingStates] = useState({}); + const accountId = useAccountId(); + const { toastMessage, showToast } = useToastMessage(); + const isMeme = useAppSelector(isMemeCategory); + const assets = useAppSelector(getAssetsCategory(isMeme)); + const [isLoading, setIsLoading] = useState(false); useEffect(() => { if (isShow) {