From 7a1eb63d425879910ff4ed7efedb2d35fcadd8a3 Mon Sep 17 00:00:00 2001 From: JimmFly <447268514@qq.com> Date: Thu, 11 Apr 2024 10:30:45 +0000 Subject: [PATCH] fix(core): unexpected routing jump behavior (#6524) https://github.com/toeverything/AFFiNE/assets/102217452/b4dba402-b07d-4f8e-a118-a35eb6e7d317 --- .../page-list/collections/collection-list-item.tsx | 6 +++--- .../core/src/components/page-list/tags/tag-list-item.tsx | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/frontend/core/src/components/page-list/collections/collection-list-item.tsx b/packages/frontend/core/src/components/page-list/collections/collection-list-item.tsx index 1dba9eaa6..81d2766ba 100644 --- a/packages/frontend/core/src/components/page-list/collections/collection-list-item.tsx +++ b/packages/frontend/core/src/components/page-list/collections/collection-list-item.tsx @@ -1,10 +1,10 @@ import { Checkbox } from '@affine/component'; import { getDNDId } from '@affine/core/hooks/affine/use-global-dnd-helper'; +import { WorkbenchLink } from '@affine/core/modules/workbench'; import { useAFFiNEI18N } from '@affine/i18n/hooks'; import { useDraggable } from '@dnd-kit/core'; import type { PropsWithChildren } from 'react'; import { useCallback, useMemo } from 'react'; -import { Link } from 'react-router-dom'; import { selectionStateAtom, useAtom } from '../scoped-atoms'; import type { @@ -219,9 +219,9 @@ function CollectionListItemWrapper({ if (to) { return ( - + {children} - + ); } else { return
{children}
; diff --git a/packages/frontend/core/src/components/page-list/tags/tag-list-item.tsx b/packages/frontend/core/src/components/page-list/tags/tag-list-item.tsx index 64e0c4e80..46763d9f7 100644 --- a/packages/frontend/core/src/components/page-list/tags/tag-list-item.tsx +++ b/packages/frontend/core/src/components/page-list/tags/tag-list-item.tsx @@ -1,10 +1,10 @@ import { Checkbox } from '@affine/component'; import { getDNDId } from '@affine/core/hooks/affine/use-global-dnd-helper'; +import { WorkbenchLink } from '@affine/core/modules/workbench'; import { useAFFiNEI18N } from '@affine/i18n/hooks'; import { useDraggable } from '@dnd-kit/core'; import type { PropsWithChildren } from 'react'; import { useCallback, useMemo } from 'react'; -import { Link } from 'react-router-dom'; import { selectionStateAtom, useAtom } from '../scoped-atoms'; import type { DraggableTitleCellData, TagListItemProps } from '../types'; @@ -205,9 +205,9 @@ function TagListItemWrapper({ if (to) { return ( - + {children} - + ); } else { return
{children}
;