@camunda/camunda-composite-components 0.2.16-rc.1 → 0.2.16-rc.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -40,6 +40,12 @@ export const C3HelpCenter = ({ autoStartSurvey, origin, flags, onRequestClose, m
|
|
|
40
40
|
themeRef.current = newTheme;
|
|
41
41
|
setResolvedTheme(resolveTheme(newTheme || "light"));
|
|
42
42
|
}, [theme, themeConfig, isOpen]);
|
|
43
|
+
const fetchConfig = async () => {
|
|
44
|
+
if (!userToken || !decodedAudience)
|
|
45
|
+
return;
|
|
46
|
+
const onboardConfig = await getConfig(userToken, decodedAudience);
|
|
47
|
+
setHelpCenterConfig(onboardConfig || defaultHelpCenterConfig);
|
|
48
|
+
};
|
|
43
49
|
const fetchData = async () => {
|
|
44
50
|
if (!userToken || !decodedToken || !decodedAudience)
|
|
45
51
|
return;
|
|
@@ -62,12 +68,16 @@ export const C3HelpCenter = ({ autoStartSurvey, origin, flags, onRequestClose, m
|
|
|
62
68
|
setIsHelpCenterOpen(true);
|
|
63
69
|
onRequestOpen?.();
|
|
64
70
|
}
|
|
65
|
-
|
|
66
|
-
setHelpCenterConfig(onboardConfig || defaultHelpCenterConfig);
|
|
71
|
+
await fetchConfig();
|
|
67
72
|
};
|
|
68
73
|
React.useEffect(() => {
|
|
69
74
|
fetchData();
|
|
70
75
|
}, [JSON.stringify(decodedToken), decodedAudience]);
|
|
76
|
+
useEffect(() => {
|
|
77
|
+
if (!userToken || !decodedAudience)
|
|
78
|
+
return;
|
|
79
|
+
fetchConfig();
|
|
80
|
+
}, [persona?.nextStep]);
|
|
71
81
|
React.useEffect(() => {
|
|
72
82
|
const tabs = helpCenterConfig.tabs;
|
|
73
83
|
const firstTab = tabs[0].id;
|
|
@@ -139,10 +149,7 @@ export const C3HelpCenter = ({ autoStartSurvey, origin, flags, onRequestClose, m
|
|
|
139
149
|
const closeFn = () => {
|
|
140
150
|
if (persona && userToken && activeOrganizationId && decodedAudience) {
|
|
141
151
|
updatePersona({
|
|
142
|
-
newPersona:
|
|
143
|
-
...persona,
|
|
144
|
-
wasShown: true,
|
|
145
|
-
},
|
|
152
|
+
newPersona: persona,
|
|
146
153
|
audience: decodedAudience,
|
|
147
154
|
accessToken: userToken,
|
|
148
155
|
orgId: activeOrganizationId,
|