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);