fix(core): add toast message (#3847)

This commit is contained in:
Noothan am
2023-08-22 05:27:11 +05:30
committed by GitHub
parent 58184679ca
commit 2a5ef04397

View File

@@ -11,6 +11,7 @@ import { useCallback, useState } from 'react';
import { useBlockSuiteMetaHelper } from '../../../hooks/affine/use-block-suite-meta-helper';
import { useCurrentWorkspace } from '../../../hooks/current/use-current-workspace';
import { useNavigateHelper } from '../../../hooks/use-navigate-helper';
import { toast } from '../../../utils';
import { buttonContainer, group } from './styles.css';
export const TrashButtonGroup = () => {
@@ -37,6 +38,7 @@ export const TrashButtonGroup = () => {
type="primary"
onClick={() => {
restoreFromTrash(pageId);
toast(t['restored']({ title: pageMeta.title || 'Untitled' }));
}}
size="large"
>
@@ -63,7 +65,8 @@ export const TrashButtonGroup = () => {
onConfirm={useCallback(() => {
jumpToSubPath(workspace.id, WorkspaceSubPath.ALL);
blockSuiteWorkspace.removePage(pageId);
}, [blockSuiteWorkspace, jumpToSubPath, pageId, workspace.id])}
toast(t['Permanently deleted']());
}, [blockSuiteWorkspace, jumpToSubPath, pageId, workspace.id, t])}
onCancel={() => {
setOpen(false);
}}