qpp-style 9.24.2-alpha.1 → 9.24.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.
@@ -43,17 +43,20 @@ const HeaderUI = ({
43
43
  };
44
44
 
45
45
  // execute on init render
46
- useEffect(async () => {
46
+ useEffect(() => {
47
47
  let cancelRequest = false;
48
48
  const { origin } = window.location;
49
49
  let navMenuItems;
50
- try {
51
- const { data } = await axios.get(`${origin}/config/header`);
52
- navMenuItems = data.data;
53
- } catch (error) {
54
- navMenuItems = { content: defaultContent };
50
+ async function getHeaderConfig() {
51
+ try {
52
+ const { data } = await axios.get(`${origin}/config/header`);
53
+ navMenuItems = data.data;
54
+ } catch (error) {
55
+ navMenuItems = { content: defaultContent };
56
+ }
57
+ if (!cancelRequest) setHeaderContent(navMenuItems);
55
58
  }
56
- if (!cancelRequest) setHeaderContent(navMenuItems);
59
+ getHeaderConfig();
57
60
  return () => {
58
61
  cancelRequest = true;
59
62
  };