chayns-api 2.2.19 → 2.2.21

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.
@@ -21,9 +21,9 @@ const WaitUntil = ({
21
21
  loadingComponent
22
22
  }) => {
23
23
  const [loaded, setLoaded] = (0, _react.useState)(() => !tasks.length);
24
- const mounted = (0, _react.useRef)(false);
25
- if (!mounted.current) handleTasks(tasks).finally(() => setLoaded(true));
26
- mounted.current = true;
24
+ (0, _react.useEffect)(() => {
25
+ handleTasks(tasks).finally(() => setLoaded(true));
26
+ }, []);
27
27
  return loaded ? children : loadingComponent;
28
28
  };
29
29
  exports.WaitUntil = WaitUntil;
@@ -1,4 +1,4 @@
1
- import { useRef, useState } from "react";
1
+ import { useEffect, useState } from "react";
2
2
  const handleTasks = async tasks => {
3
3
  for (let i = 0; i < tasks.length; i++) {
4
4
  const task = tasks[i];
@@ -16,8 +16,8 @@ export const WaitUntil = _ref => {
16
16
  loadingComponent
17
17
  } = _ref;
18
18
  const [loaded, setLoaded] = useState(() => !tasks.length);
19
- const mounted = useRef(false);
20
- if (!mounted.current) handleTasks(tasks).finally(() => setLoaded(true));
21
- mounted.current = true;
19
+ useEffect(() => {
20
+ handleTasks(tasks).finally(() => setLoaded(true));
21
+ }, []);
22
22
  return loaded ? children : loadingComponent;
23
23
  };
@@ -229,6 +229,7 @@ export declare const getSite: () => ChaynsApiSite;
229
229
  export declare const getCurrentPage: () => {
230
230
  id: number;
231
231
  siteId: string;
232
+ identifier?: string | number;
232
233
  };
233
234
  export declare const getDevice: () => ChaynsApiDevice;
234
235
  export declare const getLanguage: () => {
@@ -300,6 +300,7 @@ export interface ChaynsReactValues {
300
300
  currentPage: {
301
301
  id: number;
302
302
  siteId: string;
303
+ identifier?: string | number;
303
304
  };
304
305
  device: ChaynsApiDevice;
305
306
  language: {
@@ -829,6 +830,7 @@ export interface Page {
829
830
  sortId: number;
830
831
  siteId: string;
831
832
  uacGroups: UacGroup[];
833
+ url: string;
832
834
  }
833
835
  export declare enum Gender {
834
836
  Unknown = 0,
@@ -9,6 +9,7 @@ declare class StaticChaynsApi {
9
9
  getCurrentPage: () => {
10
10
  id: number;
11
11
  siteId: string;
12
+ identifier?: string | number;
12
13
  };
13
14
  getDevice: () => import("../types/IChaynsReact").ChaynsApiDevice;
14
15
  getLanguage: () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chayns-api",
3
- "version": "2.2.19",
3
+ "version": "2.2.21",
4
4
  "description": "new chayns api",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",