Skip to content

Commit

Permalink
fix: address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
vikrantgupta25 committed Jun 10, 2024
1 parent f2dc062 commit 1dabf8a
Showing 1 changed file with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,18 +71,18 @@ function GeneralDashboardSettings(): JSX.Element {

useEffect(() => {
let numberOfUnsavedChanges = 0;
if (!isEqual(updatedTitle, title)) {
numberOfUnsavedChanges += 1;
}
if (!isEqual(updatedDescription, description)) {
numberOfUnsavedChanges += 1;
}
if (!isEqual(updatedTags, tags)) {
numberOfUnsavedChanges += 1;
}
if (!isEqual(updatedImage, image)) {
numberOfUnsavedChanges += 1;
}
const initialValues = [title, description, tags, image];
const updatedValues = [
updatedTitle,
updatedDescription,
updatedTags,
updatedImage,
];
initialValues.forEach((val, index) => {
if (!isEqual(val, updatedValues[index])) {
numberOfUnsavedChanges += 1;
}
});
setNumberOfUnsavedChanges(numberOfUnsavedChanges);
}, [
description,
Expand Down Expand Up @@ -167,7 +167,7 @@ function GeneralDashboardSettings(): JSX.Element {
<div className="unsaved">
<div className="unsaved-dot" />
<Typography.Text className="unsaved-changes">
{numberOfUnsavedChanges} Unsaved change
{numberOfUnsavedChanges} unsaved change
{numberOfUnsavedChanges > 1 && 's'}
</Typography.Text>
</div>
Expand Down

0 comments on commit 1dabf8a

Please sign in to comment.