@camunda/camunda-composite-components 0.2.2-rc.2 → 0.2.2-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.
|
@@ -18,6 +18,7 @@ export const C3HelpCenter = ({ autoStartSurvey, origin, flags, isOpen, onRequest
|
|
|
18
18
|
const [userId, setUserId] = useState("");
|
|
19
19
|
const [token, setToken] = useState("");
|
|
20
20
|
const [audience, setAudience] = useState("");
|
|
21
|
+
const [organizationId, setOrganizationId] = useState(null);
|
|
21
22
|
const [organization, setOrganization] = useState(null);
|
|
22
23
|
const [clusters, setClusters] = useState([]);
|
|
23
24
|
const [helpCenterConfig, setHelpCenterConfig] = useState(defaultHelpCenterConfig);
|
|
@@ -75,11 +76,15 @@ export const C3HelpCenter = ({ autoStartSurvey, origin, flags, isOpen, onRequest
|
|
|
75
76
|
}
|
|
76
77
|
};
|
|
77
78
|
React.useEffect(() => {
|
|
78
|
-
|
|
79
|
+
const tokenChanged = token !== userToken && !!userToken;
|
|
80
|
+
const orgChanged = organizationId !== activeOrganizationId && !!activeOrganizationId;
|
|
81
|
+
if (tokenChanged)
|
|
79
82
|
setToken(userToken);
|
|
83
|
+
if (orgChanged)
|
|
84
|
+
setOrganizationId(activeOrganizationId);
|
|
85
|
+
if (tokenChanged || orgChanged)
|
|
80
86
|
fetchData();
|
|
81
|
-
|
|
82
|
-
}, [userToken]);
|
|
87
|
+
}, [userToken, activeOrganizationId]);
|
|
83
88
|
React.useEffect(() => {
|
|
84
89
|
const tabs = helpCenterConfig.tabs;
|
|
85
90
|
const firstTab = tabs[0].id;
|