Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix WS invite message shows html message briefly #44657

Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 4 additions & 10 deletions src/pages/workspace/WorkspaceInviteMessagePage.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import type {StackScreenProps} from '@react-navigation/stack';
import {ExpensiMark} from 'expensify-common';
import lodashDebounce from 'lodash/debounce';
import React, {useEffect, useMemo, useState} from 'react';
import {Keyboard, View} from 'react-native';
Expand All @@ -22,7 +21,6 @@ import useAutoFocusInput from '@hooks/useAutoFocusInput';
import useLocalize from '@hooks/useLocalize';
import useThemeStyles from '@hooks/useThemeStyles';
import Navigation from '@libs/Navigation/Navigation';
import {parseHtmlToMarkdown} from '@libs/OnyxAwareParser';
import * as OptionsListUtils from '@libs/OptionsListUtils';
import * as PolicyUtils from '@libs/PolicyUtils';
import updateMultilineInputRange from '@libs/updateMultilineInputRange';
Expand Down Expand Up @@ -59,8 +57,6 @@ type WorkspaceInviteMessagePageProps = WithPolicyAndFullscreenLoadingProps &
WorkspaceInviteMessagePageOnyxProps &
StackScreenProps<SettingsNavigatorParamList, typeof SCREENS.WORKSPACE.INVITE_MESSAGE>;

const parser = new ExpensiMark();

function WorkspaceInviteMessagePage({
workspaceInviteMessageDraft,
invitedEmailsToAccountIDsDraft,
Expand Down Expand Up @@ -88,15 +84,13 @@ function WorkspaceInviteMessagePage({
// policy?.description can be an empty string
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
policy?.description ||
parser.replace(
translate('workspace.common.welcomeNote', {
workspaceName: policy?.name ?? '',
}),
);
translate('workspace.common.welcomeNote', {
workspaceName: policy?.name ?? '',
});

useEffect(() => {
if (!isEmptyObject(invitedEmailsToAccountIDsDraft)) {
setWelcomeNote(parseHtmlToMarkdown(getDefaultWelcomeNote()));
setWelcomeNote(getDefaultWelcomeNote());
return;
}
Navigation.goBack(ROUTES.WORKSPACE_INVITE.getRoute(route.params.policyID), true);
Expand Down
Loading