Skip to content

Commit 2438153

Browse files
author
Edward Marzal
committed
added invoke of heap analytics
1 parent 0bbee03 commit 2438153

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

ui/src/containers/ConfigScreen/index.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,16 @@ import "tippy.js/dist/tippy.css";
2020
import "./styles.scss";
2121

2222
import useJsErrorTracker from "../../hooks/useJsErrorTracker";
23+
import { useAppSdk } from "../../hooks/useAppSdk";
24+
import useAnalytics from "../../hooks/useAnalytics";
2325

2426
const ConfigScreen: React.FC = function () {
2527

2628
// error tracking hooks
2729
const { addMetadata, trackError } = useJsErrorTracker();
30+
const { trackEvent } = useAnalytics();
31+
const [appSdk] = useAppSdk();
32+
2833

2934
const [state, setState] = useState<TypeAppSdkConfigState>({
3035
installationData: {
@@ -45,7 +50,7 @@ const ConfigScreen: React.FC = function () {
4550

4651
useEffect(() => {
4752
ContentstackAppSdk.init()
48-
.then(async (appSdk) => {
53+
.then(async (appSdk: AppSdkProps) => {
4954
//Adding Track.js metadata
5055
TrackJS.addMetadata(appSdk);
5156

@@ -108,6 +113,7 @@ const ConfigScreen: React.FC = function () {
108113

109114
const updateCustomJSON = (e: any) => {
110115
const val = e?.target?.id !== "jsonObject";
116+
trackEvent("State", { property: `Update Json` });
111117
setIsStringified(val);
112118
updateConfig({ target: { name: "isStringified", value: val } });
113119
};

0 commit comments

Comments
 (0)