feat: update list when deleting a page from all pages (#1086)
This commit is contained in:
@@ -4,16 +4,13 @@ import { PageListHeader } from '@/components/header';
|
|||||||
import { ReactElement, useCallback } from 'react';
|
import { ReactElement, useCallback } from 'react';
|
||||||
import WorkspaceLayout from '@/components/workspace-layout';
|
import WorkspaceLayout from '@/components/workspace-layout';
|
||||||
import { useTranslation } from '@affine/i18n';
|
import { useTranslation } from '@affine/i18n';
|
||||||
import { PageMeta } from '@/providers/app-state-provider';
|
|
||||||
import Head from 'next/head';
|
import Head from 'next/head';
|
||||||
import { useGlobalState } from '@/store/app';
|
import { useGlobalState } from '@/store/app';
|
||||||
|
|
||||||
const All = () => {
|
const All = () => {
|
||||||
const currentWorkspace = useGlobalState(
|
const pageList = useGlobalState(
|
||||||
useCallback(store => store.currentDataCenterWorkspace, [])
|
useCallback(store => store.dataCenterPageList, [])
|
||||||
);
|
);
|
||||||
const pageList = (currentWorkspace?.blocksuiteWorkspace?.meta.pageMetas ||
|
|
||||||
[]) as PageMeta[];
|
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
|||||||
@@ -1,13 +1,16 @@
|
|||||||
import { PageListHeader } from '@/components/header';
|
import { PageListHeader } from '@/components/header';
|
||||||
import { PageList } from '@/components/page-list';
|
import { PageList } from '@/components/page-list';
|
||||||
import { TrashIcon } from '@blocksuite/icons';
|
import { TrashIcon } from '@blocksuite/icons';
|
||||||
import { ReactElement } from 'react';
|
import { ReactElement, useCallback } from 'react';
|
||||||
import WorkspaceLayout from '@/components/workspace-layout';
|
import WorkspaceLayout from '@/components/workspace-layout';
|
||||||
import { useTranslation } from '@affine/i18n';
|
import { useTranslation } from '@affine/i18n';
|
||||||
import Head from 'next/head';
|
import Head from 'next/head';
|
||||||
import { useGlobalState } from '@/store/app';
|
import { useGlobalState } from '@/store/app';
|
||||||
|
|
||||||
export const Trash = () => {
|
export const Trash = () => {
|
||||||
const pageList = useGlobalState(store => store.dataCenterPageList);
|
const pageList = useGlobalState(
|
||||||
|
useCallback(store => store.dataCenterPageList, [])
|
||||||
|
);
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
|||||||
Reference in New Issue
Block a user