@camunda/camunda-composite-components 0.2.16-rc.2 → 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;
|
|
@@ -34,7 +34,7 @@ export const C3OnboardingSurvey = (props) => {
|
|
|
34
34
|
setOnboardConfig(config);
|
|
35
35
|
setIsLoadingConfig(false);
|
|
36
36
|
})();
|
|
37
|
-
}, [JSON.stringify(decodedToken), decodedAudience
|
|
37
|
+
}, [JSON.stringify(decodedToken), decodedAudience]);
|
|
38
38
|
React.useEffect(() => {
|
|
39
39
|
setPersona(props.persona);
|
|
40
40
|
}, [props.persona]);
|