Skip to content

Commit e12c7f8

Browse files
fix: react ga wrapper func
1 parent 0d8193f commit e12c7f8

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

src/components/app/Overview/Overview.tsx

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,6 @@ export default function AppOverview({ appMetaInfo, getAppMetaInfoRes, filteredEn
8080
}
8181

8282
const toggleUpdateDependencyModal = () => {
83-
ReactGA.event({
84-
category: 'Application Dependency',
85-
action: 'Edit Dependency',
86-
label: 'Edit Dependency',
87-
})
88-
8983
if (isUpdateDependencyModalOpen) {
9084
searchParams.delete(MODAL_STATE.key)
9185
} else {
@@ -94,6 +88,15 @@ export default function AppOverview({ appMetaInfo, getAppMetaInfoRes, filteredEn
9488
history.replace({ search: searchParams.toString() })
9589
}
9690

91+
const handleEditDependencyClick = () => {
92+
ReactGA.event({
93+
category: 'Application Dependency',
94+
action: 'Edit Dependency click',
95+
label: 'Edit Dependency click',
96+
})
97+
toggleUpdateDependencyModal()
98+
}
99+
97100
useEffect(() => {
98101
// add a default tab if not set
99102
if (!activeTab || !Object.values(OVERVIEW_TABS).includes(activeTab)) {
@@ -515,7 +518,7 @@ export default function AppOverview({ appMetaInfo, getAppMetaInfoRes, filteredEn
515518
<button
516519
type="button"
517520
className={`cta flex h-28 dc__gap-4 ${isEditDependencyButtonDisabled ? 'disabled-opacity' : ''}`}
518-
onClick={isEditDependencyButtonDisabled ? noop : toggleUpdateDependencyModal}
521+
onClick={isEditDependencyButtonDisabled ? noop : handleEditDependencyClick}
519522
>
520523
<EditIcon className="mw-14 icon-dim-14 scn-0 dc__no-svg-fill" />
521524
Edit Dependency

0 commit comments

Comments
 (0)