فهرست منبع

fix: ensure sidebar edit link is only shown when data is available

Shun Miyazawa 2 ماه پیش
والد
کامیت
0fa140f51e
1فایلهای تغییر یافته به همراه2 افزوده شده و 2 حذف شده
  1. 2 2
      apps/app/src/client/components/Sidebar/Custom/CustomSidebar.tsx

+ 2 - 2
apps/app/src/client/components/Sidebar/Custom/CustomSidebar.tsx

@@ -19,14 +19,14 @@ const CustomSidebarContent = dynamic(
 export const CustomSidebar = (): JSX.Element => {
 export const CustomSidebar = (): JSX.Element => {
   const { t } = useTranslation();
   const { t } = useTranslation();
 
 
-  const { mutate, isLoading } = useSWRxPageByPath('/Sidebar');
+  const { data, mutate, isLoading } = useSWRxPageByPath('/Sidebar');
 
 
   return (
   return (
     <div className="pt-4 pb-3 px-3">
     <div className="pt-4 pb-3 px-3">
       <div className="grw-sidebar-content-header d-flex">
       <div className="grw-sidebar-content-header d-flex">
         <h3 className="fs-6 fw-bold mb-0">
         <h3 className="fs-6 fw-bold mb-0">
           {t('Custom Sidebar')}
           {t('Custom Sidebar')}
-          {!isLoading && (
+          {!isLoading && data != null && (
             <Link href="/Sidebar#edit" className="h6 ms-2">
             <Link href="/Sidebar#edit" className="h6 ms-2">
               <span className="material-symbols-outlined">edit</span>
               <span className="material-symbols-outlined">edit</span>
             </Link>
             </Link>