From 893eafbdeb065693149ab3657e63b61ddff4aba9 Mon Sep 17 00:00:00 2001 From: PhilReact Date: Mon, 11 Nov 2024 18:59:40 +0200 Subject: [PATCH] refresh apps --- src/atoms/global.ts | 4 ++++ src/components/Apps/AppsCategoryDesktop.tsx | 1 + src/components/Apps/AppsDesktop.tsx | 14 +++++++++-- src/components/Apps/AppsLibrary.tsx | 1 + src/components/Apps/AppsLibraryDesktop.tsx | 26 ++++++++++++++++++++- 5 files changed, 43 insertions(+), 3 deletions(-) diff --git a/src/atoms/global.ts b/src/atoms/global.ts index 4bb43b2..5e9c2bc 100644 --- a/src/atoms/global.ts +++ b/src/atoms/global.ts @@ -24,6 +24,10 @@ export const sortablePinnedAppsAtom = atom({ },{ name: 'Qombo', service: 'APP' + }, + { + name: 'Q-Trade', + service: 'APP' } ], }); diff --git a/src/components/Apps/AppsCategoryDesktop.tsx b/src/components/Apps/AppsCategoryDesktop.tsx index 206eef0..456c597 100644 --- a/src/components/Apps/AppsCategoryDesktop.tsx +++ b/src/components/Apps/AppsCategoryDesktop.tsx @@ -47,6 +47,7 @@ const officialAppList = [ "qombo", "q-fund", "q-shop", + "q-trade" ]; const ScrollerStyled = styled("div")({ diff --git a/src/components/Apps/AppsDesktop.tsx b/src/components/Apps/AppsDesktop.tsx index 0f4cf15..5dfce81 100644 --- a/src/components/Apps/AppsDesktop.tsx +++ b/src/components/Apps/AppsDesktop.tsx @@ -117,9 +117,18 @@ export const AppsDesktop = ({ mode, setMode, show , myName, goToHome, setDesktop } }, []); useEffect(() => { - getQapps(); getCategories() - }, [getQapps, getCategories]); + }, [getCategories]); + + useEffect(() => { + getQapps(); + + const interval = setInterval(() => { + getQapps(); + }, 20 * 60 * 1000); // 20 minutes in milliseconds + + return () => clearInterval(interval); + }, [getQapps]); const selectedAppInfoFunc = (e) => { const data = e.detail?.data; @@ -445,6 +454,7 @@ export const AppsDesktop = ({ mode, setMode, show , myName, goToHome, setDesktop myName={myName} hasPublishApp={!!(myApp || myWebsite)} categories={categories} + getQapps={getQapps} /> {mode === "appInfo" && !selectedTab && } diff --git a/src/components/Apps/AppsLibrary.tsx b/src/components/Apps/AppsLibrary.tsx index cfe5b3f..87ddbbc 100644 --- a/src/components/Apps/AppsLibrary.tsx +++ b/src/components/Apps/AppsLibrary.tsx @@ -41,6 +41,7 @@ const officialAppList = [ "qombo", "q-fund", "q-shop", + "q-trade" ]; const ScrollerStyled = styled('div')({ diff --git a/src/components/Apps/AppsLibraryDesktop.tsx b/src/components/Apps/AppsLibraryDesktop.tsx index 89907db..5a0012a 100644 --- a/src/components/Apps/AppsLibraryDesktop.tsx +++ b/src/components/Apps/AppsLibraryDesktop.tsx @@ -32,6 +32,7 @@ import IconSearch from "../../assets/svgs/Search.svg"; import IconClearInput from "../../assets/svgs/ClearInput.svg"; import qappDevelopText from "../../assets/svgs/qappDevelopText.svg"; import qappLibraryText from "../../assets/svgs/qappLibraryText.svg"; +import RefreshIcon from "@mui/icons-material/Refresh"; import qappDots from "../../assets/svgs/qappDots.svg"; @@ -55,6 +56,7 @@ const officialAppList = [ "qombo", "q-fund", "q-shop", + "q-trade" ]; const ScrollerStyled = styled("div")({ @@ -96,7 +98,8 @@ export const AppsLibraryDesktop = ({ myName, hasPublishApp, isShow, - categories + categories, + getQapps }) => { const [searchValue, setSearchValue] = useState(""); const virtuosoRef = useRef(); @@ -169,6 +172,11 @@ export const AppsLibraryDesktop = ({ }} > + + { + getQapps() + }} + > + + + +