diff --git a/frontend/src/layouts/AppLayout/AppLayout.tsx b/frontend/src/layouts/AppLayout/AppLayout.tsx index 19fb964f8..b57007fd1 100644 --- a/frontend/src/layouts/AppLayout/AppLayout.tsx +++ b/frontend/src/layouts/AppLayout/AppLayout.tsx @@ -7,7 +7,7 @@ // @ts-nocheck import crypto from "crypto"; -import { useEffect, useState } from "react"; +import { useEffect } from "react"; import { Controller, useForm } from "react-hook-form"; import { useTranslation } from "react-i18next"; import Image from "next/image"; @@ -68,11 +68,10 @@ import { useCreateWorkspace, useGetOrgTrialUrl, useGetSecretApprovalRequestCount, + useGetUserAction, useLogoutUser, useRegisterUserAction, - useUploadWsKey -} from "@app/hooks/api"; -import { fetchUserAction } from "@app/hooks/api/users/queries"; + useUploadWsKey} from "@app/hooks/api"; interface LayoutProps { children: React.ReactNode; @@ -119,7 +118,8 @@ export const AppLayout = ({ children }: LayoutProps) => { const { user } = useUser(); const { subscription } = useSubscription(); const workspaceId = currentWorkspace?._id || ""; - const [ isLearningNoteOpen, setIsLearningNoteOpen ] = useState(false); + const { data: updateClosed } = useGetUserAction("september_update_closed"); + const { data: secretApprovalReqCount } = useGetSecretApprovalRequestCount({ workspaceId }); const isAddingProjectsAllowed = subscription?.workspaceLimit @@ -148,19 +148,8 @@ export const AppLayout = ({ children }: LayoutProps) => { const registerUserAction = useRegisterUserAction(); - useEffect(async () => { - const checkLearningNote = async () => { - const userUpdateClosedCheck = await fetchUserAction( - "september_update_closed" - ); - setIsLearningNoteOpen(!userUpdateClosedCheck); - } - checkLearningNote(); - }) - const closeUpdate = async () => { await registerUserAction.mutateAsync("september_update_closed"); - setIsLearningNoteOpen(false); } const logout = useLogoutUser(); @@ -621,7 +610,7 @@ export const AppLayout = ({ children }: LayoutProps) => {
*/} -