mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 21:05:19 +00:00
refactor(core): remove collection atom (#5832)
This commit is contained in:
@@ -44,7 +44,7 @@ export function useNavigateHelper() {
|
||||
);
|
||||
const jumpToCollections = useCallback(
|
||||
(workspaceId: string, logic: RouteLogic = RouteLogic.PUSH) => {
|
||||
return navigate(`/workspace/${workspaceId}/all?filterMode=collections`, {
|
||||
return navigate(`/workspace/${workspaceId}/collection`, {
|
||||
replace: logic === RouteLogic.REPLACE,
|
||||
});
|
||||
},
|
||||
@@ -52,7 +52,7 @@ export function useNavigateHelper() {
|
||||
);
|
||||
const jumpToTags = useCallback(
|
||||
(workspaceId: string, logic: RouteLogic = RouteLogic.PUSH) => {
|
||||
return navigate(`/workspace/${workspaceId}/all?filterMode=tags`, {
|
||||
return navigate(`/workspace/${workspaceId}/tag`, {
|
||||
replace: logic === RouteLogic.REPLACE,
|
||||
});
|
||||
},
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
||||
import { Workspace } from '@toeverything/infra';
|
||||
import { useService } from '@toeverything/infra/di';
|
||||
import { useSetAtom, useStore } from 'jotai';
|
||||
import { useStore } from 'jotai';
|
||||
import { useTheme } from 'next-themes';
|
||||
import { useEffect } from 'react';
|
||||
|
||||
import { allPageModeSelectAtom } from '../atoms';
|
||||
import {
|
||||
registerAffineCreationCommands,
|
||||
registerAffineHelpCommands,
|
||||
@@ -27,7 +26,6 @@ export function useRegisterWorkspaceCommands() {
|
||||
const languageHelper = useLanguageHelper();
|
||||
const pageHelper = usePageHelper(currentWorkspace.blockSuiteWorkspace);
|
||||
const navigationHelper = useNavigateHelper();
|
||||
const setPageListMode = useSetAtom(allPageModeSelectAtom);
|
||||
const [editor] = useActiveBlocksuiteEditor();
|
||||
|
||||
// register AffineUpdatesCommands
|
||||
@@ -49,19 +47,12 @@ export function useRegisterWorkspaceCommands() {
|
||||
t,
|
||||
workspace: currentWorkspace.blockSuiteWorkspace,
|
||||
navigationHelper,
|
||||
setPageListMode,
|
||||
});
|
||||
|
||||
return () => {
|
||||
unsub();
|
||||
};
|
||||
}, [
|
||||
store,
|
||||
t,
|
||||
currentWorkspace.blockSuiteWorkspace,
|
||||
navigationHelper,
|
||||
setPageListMode,
|
||||
]);
|
||||
}, [store, t, currentWorkspace.blockSuiteWorkspace, navigationHelper]);
|
||||
|
||||
// register AffineSettingsCommands
|
||||
useEffect(() => {
|
||||
|
||||
Reference in New Issue
Block a user