From 5864ca8ad514dc1f17e4943f469ba9a0470d6058 Mon Sep 17 00:00:00 2001 From: Roji Philip Date: Mon, 30 Sep 2024 23:33:08 +0530 Subject: [PATCH] fix for empty welcome note --- src/pages/workspace/WorkspaceInviteMessagePage.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/workspace/WorkspaceInviteMessagePage.tsx b/src/pages/workspace/WorkspaceInviteMessagePage.tsx index 3899656424ac..65776deb7f9a 100644 --- a/src/pages/workspace/WorkspaceInviteMessagePage.tsx +++ b/src/pages/workspace/WorkspaceInviteMessagePage.tsx @@ -87,11 +87,11 @@ function WorkspaceInviteMessagePage({policy, route, currentUserPersonalDetails}: }, []); useEffect(() => { - if (isEmptyObject(invitedEmailsToAccountIDsDraft)) { + if (isEmptyObject(invitedEmailsToAccountIDsDraft) || !welcomeNote) { return; } setWelcomeNote(getDefaultWelcomeNote()); - }, [getDefaultWelcomeNote, invitedEmailsToAccountIDsDraft]); + }, [getDefaultWelcomeNote, invitedEmailsToAccountIDsDraft, welcomeNote]); const debouncedSaveDraft = lodashDebounce((newDraft: string | null) => { Policy.setWorkspaceInviteMessageDraft(route.params.policyID, newDraft);