feat: update list when deleting a page from all pages (#1086)

This commit is contained in:
zqran 2023-02-17 13:45:31 +08:00 committed by GitHub
parent 5aa835deb6
commit b6906467be
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 7 deletions

View File

@ -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 (
<>

View File

@ -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 (
<>