Skip to content

Commit db37a6c

Browse files
Venkataramanan VenkateswaranVenkataramanan Venkateswaran
authored andcommitted
Venkataramanan fix: time log page error when time entered is a huge number
1 parent 3cabe51 commit db37a6c

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

src/components/Timelog/TimeEntry.jsx

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,9 @@ function TimeEntry(props) {
114114
editFilteredColor();
115115
}, []);
116116

117+
const hasHtmlTags =
118+
typeof notes === 'string' && /<\/?[a-z][\s\S]*>/i.test(notes);
119+
117120
return (
118121
<div style={{ display: 'flex' }}>
119122
<div
@@ -177,9 +180,12 @@ function TimeEntry(props) {
177180
<Col md={5} className="pl-2 pr-0">
178181
<div className="time-entry-container">
179182
<div className={`notes-section ${darkMode ? 'notes-text-light' : ''}`}>
180-
<div className={darkMode ? "dark-text-muted" : "text-muted"}>Notes:</div>
181-
{parse(notes)}
182-
</div>
183+
<div className={darkMode ? 'dark-text-muted' : 'text-muted'}>Notes:</div>
184+
185+
{hasHtmlTags
186+
? parse(notes)
187+
: <span>{notes != null ? String(notes) : ''}</span>}
188+
</div>
183189
<div className="d-flex justify-content-end">
184190
{(hasATimeEntryEditPermission || isAuthUserAndSameDayEntry) &&
185191
!cantEditJaeRelatedRecord && (

0 commit comments

Comments
 (0)