From c9c2194a574001dcf4351b8182f2149d1bda2637 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Fri, 7 Oct 2022 20:36:04 -0700 Subject: [PATCH] Remove delete icon when no note is present. --- .../pane/save-and-delete/index.tsx | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/packages/editor/src/components/action-widget/pane/save-and-delete/index.tsx b/packages/editor/src/components/action-widget/pane/save-and-delete/index.tsx index 3c952254..0e622df3 100644 --- a/packages/editor/src/components/action-widget/pane/save-and-delete/index.tsx +++ b/packages/editor/src/components/action-widget/pane/save-and-delete/index.tsx @@ -13,20 +13,22 @@ const SaveAndDelete = (props: { }) => { return ( - { - props.closeModal(); - props.model.setValue(undefined); - }} - > - - + {props.model.getValue() && props.model.getValue().trim() !== '' && ( + { + props.closeModal(); + props.model.setValue(undefined); + }} + > + + + )} ); };