refactor(web): move current atoms into plugin infra (#3220)

This commit is contained in:
Alex Yang
2023-07-13 20:14:30 +08:00
committed by GitHub
parent 0230cea16e
commit 64cf297399
13 changed files with 91 additions and 98 deletions
@@ -1,10 +1,10 @@
import { rootCurrentPageIdAtom } from '@affine/workspace/atom';
import { currentPageIdAtom } from '@toeverything/plugin-infra/manager';
import { atom, useAtomValue } from 'jotai';
import { pageSettingFamily } from '../../atoms';
const currentModeAtom = atom<'page' | 'edgeless'>(get => {
const pageId = get(rootCurrentPageIdAtom);
const pageId = get(currentPageIdAtom);
// fixme(himself65): pageId should not be null
if (!pageId) {
return 'page';