Skip to content

Commit

Permalink
Merge pull request #47703 from etCoderDysto/unlink-message
Browse files Browse the repository at this point in the history
fix: Technical message is displayed when clicking unlink button
  • Loading branch information
stitesExpensify authored Aug 21, 2024
2 parents ccc4f56 + c32809f commit 6bd0782
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/pages/signin/UnlinkLoginForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ function UnlinkLoginForm({account, credentials}: UnlinkLoginFormProps) {
const styles = useThemeStyles();
const {translate} = useLocalize();
const {isOffline} = useNetwork();
const unlinkMessage = account?.message === 'unlinkLoginForm.linkSent' || account?.message === 'unlinkLoginForm.succesfullyUnlinkedLogin' ? translate(account?.message) : account?.message;
const primaryLogin = useMemo(() => {
if (!account?.primaryLogin) {
return '';
Expand All @@ -53,13 +54,13 @@ function UnlinkLoginForm({account, credentials}: UnlinkLoginFormProps) {
<View style={[styles.mv5]}>
<Text>{translate('unlinkLoginForm.noLongerHaveAccess', {primaryLogin})}</Text>
</View>
{!!account?.message && (
{!!unlinkMessage && (
// DotIndicatorMessage mostly expects onyxData errors, so we need to mock an object so that the messages looks similar to prop.account.errors
<DotIndicatorMessage
style={[styles.mb5, styles.flex0]}
type="success"
// eslint-disable-next-line @typescript-eslint/naming-convention
messages={{0: account.message}}
messages={{0: unlinkMessage}}
/>
)}
{!!account?.errors && !isEmptyObject(account.errors) && (
Expand Down

0 comments on commit 6bd0782

Please sign in to comment.