Skip to content

Commit

Permalink
handle when there are no changes
Browse files Browse the repository at this point in the history
  • Loading branch information
johnclary committed Nov 14, 2023
1 parent c7b90b7 commit 6ee7025
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,11 @@ export const formatComponentsActivity = (
}
});

// handle an edge case where only ignored fields were edited
if (changes.length === 0) {
return { changeIcon: null, changeText: null };
}

return {
changeIcon,
changeText: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,11 @@ const ProjectActivityLog = () => {
lookupData,
projectId
);
// allows log formatters to return a `null` changeText, causing the
// event to not be rendered at all
if (!changeText) {
return null;
}
return (
<TableRow key={change.activity_id}>
<TableCell
Expand Down

0 comments on commit 6ee7025

Please sign in to comment.