Skip to content

Commit 58a55fa

Browse files
author
Edward Marzal
committed
feedback added
1 parent 2438153 commit 58a55fa

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

ui/src/containers/ConfigScreen/index.tsx

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,13 @@ const ConfigScreen: React.FC = function () {
4646
},
4747
appSdkInitialized: false,
4848
});
49-
const [isStringified, setIsStringified] = useState(false);
49+
const [isStringified,setIsStringified]=useState(false);
5050

5151
useEffect(() => {
5252
ContentstackAppSdk.init()
53-
.then(async (appSdk: AppSdkProps) => {
53+
.then(async (appSdk:AppSdkProps) => {
5454
//Adding Track.js metadata
5555
TrackJS.addMetadata(appSdk);
56-
5756
const sdkConfigData = appSdk?.location?.AppConfigWidget?.installation;
5857
if (sdkConfigData) {
5958
const installationDataFromSDK =
@@ -71,13 +70,11 @@ const ConfigScreen: React.FC = function () {
7170
setIsStringified(
7271
state?.installationData?.configuration?.isStringified
7372
);
74-
7573
// setting metadata for js error tracker
7674
addMetadata("stack", `${appSdk?.stack._data.name}`);
7775
addMetadata("organization", `${appSdk?.currentUser.defaultOrganization}`);
7876
addMetadata("api_key", `${stackKey}`);
7977
addMetadata("user_uid", `${appSdk?.stack._data.collaborators[0].uid}`);
80-
8178
}
8279
})
8380
.catch((error) => {
@@ -96,10 +93,8 @@ const ConfigScreen: React.FC = function () {
9693
if (typeof fieldValue === "string") fieldValue = fieldValue?.trim();
9794
const updatedConfig = state?.installationData?.configuration || {};
9895
const updatedServerConfig = state?.installationData?.serverConfiguration;
99-
10096
if (fieldName === "auth_token") updatedServerConfig[fieldName] = fieldValue;
10197
else updatedConfig[fieldName] = fieldValue;
102-
10398
if (typeof state?.setInstallationData !== "undefined") {
10499
await state?.setInstallationData({
105100
...state?.installationData,
@@ -113,7 +108,7 @@ const ConfigScreen: React.FC = function () {
113108

114109
const updateCustomJSON = (e: any) => {
115110
const val = e?.target?.id !== "jsonObject";
116-
trackEvent("State", { property: `Update Json` });
111+
trackEvent("Clicked", { property: `Update Json` });
117112
setIsStringified(val);
118113
updateConfig({ target: { name: "isStringified", value: val } });
119114
};

0 commit comments

Comments
 (0)