diff --git a/src/components/layout/header/internal/Activity.tsx b/src/components/layout/header/internal/Activity.tsx index a4d616906c..c46061cc59 100644 --- a/src/components/layout/header/internal/Activity.tsx +++ b/src/components/layout/header/internal/Activity.tsx @@ -109,6 +109,7 @@ const ActivityIcon = memo(() => { } setActivityProcessInfo({ name: data.processInfo?.name || data.processName, + iconUrl: data.processInfo?.iconUrl, iconBase64: data.processInfo?.iconBase64, description: data.processInfo?.description, }) @@ -203,7 +204,11 @@ const TriggerComponent = memo<{ const isBuiltIn = !!appIcon[processName] const src = - !isBuiltIn && icon ? icon : `${CND_DOMAIN}/apps/${appIcon[processName]}.png` + !isBuiltIn && icon + ? icon + : isBuiltIn + ? `${CND_DOMAIN}/apps/${appIcon[processName]}.png` + : '' const className = clsx('pointer-events-none select-none', { 'rounded-md': !isBuiltIn, @@ -214,7 +219,7 @@ const TriggerComponent = memo<{ {processName} { if (!origin) return null return ( {data?.shiju}}> -
+

{origin.title}

diff --git a/src/components/modules/dashboard/post-editing/SlugInput.tsx b/src/components/modules/dashboard/post-editing/SlugInput.tsx index 29b79c3916..a00ec40c6f 100644 --- a/src/components/modules/dashboard/post-editing/SlugInput.tsx +++ b/src/components/modules/dashboard/post-editing/SlugInput.tsx @@ -1,5 +1,6 @@ import { useQuery } from '@tanstack/react-query' -import { useEffect, useRef } from 'react' +import { useEffect, useMemo, useRef } from 'react' +import type { CategoryModel } from '@mx-space/api-client' import { adminQueries } from '~/queries/definition' @@ -22,14 +23,24 @@ export const SlugInput = () => { setCategoryId(category.id) } }, [category, categoryId, setCategoryId]) + const categoryIdMap: Record = useMemo(() => { + if (!categories) return {} + return categories.data.reduce( + (acc, category) => ({ + ...acc, + [category.id]: category, + }), + {}, + ) + }, [categories]) const isLoading = !category return ( <> - {isLoading ? ( -
+ {isLoading || !categoryId ? ( +
) : ( - + )}