mirror of
https://github.com/invoke-ai/InvokeAI.git
synced 2026-04-23 03:00:31 -04:00
fix(ui): other stuff borked by rebase
This commit is contained in:
@@ -22,7 +22,7 @@ import { memo, useCallback, useMemo } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { PiArrowCounterClockwiseBold, PiUsersBold } from 'react-icons/pi';
|
||||
import { useDispatch } from 'react-redux';
|
||||
import { useGetCountsByTagQuery, useListWorkflowsQuery } from 'services/api/endpoints/workflows';
|
||||
import { useGetCountsByTagQuery } from 'services/api/endpoints/workflows';
|
||||
import type { S } from 'services/api/types';
|
||||
|
||||
export const WorkflowLibrarySideNav = () => {
|
||||
@@ -93,9 +93,6 @@ export const WorkflowLibrarySideNav = () => {
|
||||
<CategoryButton isSelected={isRecentWorkflowsSelected} onClick={selectRecentWorkflows}>
|
||||
{t('workflows.recentlyOpened')}
|
||||
</CategoryButton>
|
||||
<Flex flexDir="column" gap={2} pl={4}>
|
||||
<RecentWorkflows />
|
||||
</Flex>
|
||||
</Flex>
|
||||
<Flex flexDir="column" w="full" pb={2}>
|
||||
<CategoryButton isSelected={isYourWorkflowsSelected} onClick={selectYourWorkflows}>
|
||||
@@ -167,36 +164,6 @@ export const WorkflowLibrarySideNav = () => {
|
||||
);
|
||||
};
|
||||
|
||||
const recentWorkflowsQueryArg = {
|
||||
page: 0,
|
||||
per_page: 5,
|
||||
order_by: 'opened_at',
|
||||
direction: 'DESC',
|
||||
is_recent: true,
|
||||
} satisfies Parameters<typeof useListWorkflowsQuery>[0];
|
||||
|
||||
const RecentWorkflows = memo(() => {
|
||||
const { t } = useTranslation();
|
||||
const { data, isLoading } = useListWorkflowsQuery(recentWorkflowsQueryArg);
|
||||
|
||||
if (isLoading || !data) {
|
||||
return <Text variant="subtext">{t('common.loading')}</Text>;
|
||||
}
|
||||
|
||||
if (data.items.length === 0) {
|
||||
return <Text variant="subtext" p={4}>{t('workflows.noRecentWorkflows')}</Text>;
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
{data.items.map((workflow) => {
|
||||
return <RecentWorkflowButton key={workflow.workflow_id} workflow={workflow} />;
|
||||
})}
|
||||
</>
|
||||
);
|
||||
});
|
||||
RecentWorkflows.displayName = 'RecentWorkflows';
|
||||
|
||||
const useCountForIndividualTag = (tag: string) => {
|
||||
const allTags = useStore($workflowLibraryTagOptions);
|
||||
const queryArg = useMemo(
|
||||
|
||||
Reference in New Issue
Block a user