Skip to content

Commit

Permalink
minor(ui): reset displayName to avoid being persisted (#18024)
Browse files Browse the repository at this point in the history
  • Loading branch information
chirag-madlani committed Sep 28, 2024
1 parent a0119b8 commit f9e70f8
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { ExclamationCircleFilled } from '@ant-design/icons';
import { Button, Divider, Input, Space, Tooltip, Typography } from 'antd';
import { AxiosError } from 'axios';
import { isEmpty } from 'lodash';
import React, { useCallback, useMemo, useState } from 'react';
import React, { useCallback, useEffect, useMemo, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { ReactComponent as EditIcon } from '../../../../../assets/svg/edit-new.svg';
import {
Expand Down Expand Up @@ -269,6 +269,11 @@ const UserProfileDetails = ({
}
}, [userData.id]);

useEffect(() => {
// Reset display name when user data changes
setDisplayName(userData.displayName);
}, [userData.displayName]);

return (
<>
<Space
Expand Down

0 comments on commit f9e70f8

Please sign in to comment.