mirror of
https://github.com/toeverything/AFFiNE.git
synced 2024-09-21 08:28:58 +03:00
feat: update list when deleting a page from all pages (#1086)
This commit is contained in:
parent
5aa835deb6
commit
b6906467be
@ -4,16 +4,13 @@ import { PageListHeader } from '@/components/header';
|
||||
import { ReactElement, useCallback } from 'react';
|
||||
import WorkspaceLayout from '@/components/workspace-layout';
|
||||
import { useTranslation } from '@affine/i18n';
|
||||
import { PageMeta } from '@/providers/app-state-provider';
|
||||
import Head from 'next/head';
|
||||
import { useGlobalState } from '@/store/app';
|
||||
|
||||
const All = () => {
|
||||
const currentWorkspace = useGlobalState(
|
||||
useCallback(store => store.currentDataCenterWorkspace, [])
|
||||
const pageList = useGlobalState(
|
||||
useCallback(store => store.dataCenterPageList, [])
|
||||
);
|
||||
const pageList = (currentWorkspace?.blocksuiteWorkspace?.meta.pageMetas ||
|
||||
[]) as PageMeta[];
|
||||
const { t } = useTranslation();
|
||||
return (
|
||||
<>
|
||||
|
@ -1,13 +1,16 @@
|
||||
import { PageListHeader } from '@/components/header';
|
||||
import { PageList } from '@/components/page-list';
|
||||
import { TrashIcon } from '@blocksuite/icons';
|
||||
import { ReactElement } from 'react';
|
||||
import { ReactElement, useCallback } from 'react';
|
||||
import WorkspaceLayout from '@/components/workspace-layout';
|
||||
import { useTranslation } from '@affine/i18n';
|
||||
import Head from 'next/head';
|
||||
import { useGlobalState } from '@/store/app';
|
||||
|
||||
export const Trash = () => {
|
||||
const pageList = useGlobalState(store => store.dataCenterPageList);
|
||||
const pageList = useGlobalState(
|
||||
useCallback(store => store.dataCenterPageList, [])
|
||||
);
|
||||
const { t } = useTranslation();
|
||||
return (
|
||||
<>
|
||||
|
Loading…
Reference in New Issue
Block a user