From 73aea1e2d1b293d99db512a4125b5f6d104bf5e1 Mon Sep 17 00:00:00 2001 From: Noothan am <100135382+Noothan-am@users.noreply.github.com> Date: Tue, 22 Aug 2023 05:27:11 +0530 Subject: [PATCH] fix(core): add toast message (#3847) (cherry picked from commit 2a5ef04397dcba1d3d4731ced7b5974653a710e7) --- apps/core/src/components/pure/trash-button-group/index.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/core/src/components/pure/trash-button-group/index.tsx b/apps/core/src/components/pure/trash-button-group/index.tsx index c3fade095f..068968ebde 100644 --- a/apps/core/src/components/pure/trash-button-group/index.tsx +++ b/apps/core/src/components/pure/trash-button-group/index.tsx @@ -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); }}