@pushwoosh/smart-components-kit 1.3.27 → 1.3.28

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.
@@ -2,6 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { Spinner } from '@pushwoosh/dumb-components';
3
3
  import { Horizontal, useAsync } from '@pushwoosh/kit-helpers';
4
4
  import { useSPAContext } from '@pushwoosh/spa-context';
5
+ import { collectPaginatedData } from '../asyncHelpers';
5
6
  import { langCodes } from './constants';
6
7
  import { LanguagesSelectForm } from './LanguagesSelectForm';
7
8
  import { resolveLanguageAudience } from './platforms';
@@ -18,12 +19,16 @@ export const LanguagesSelectFormLoader = ({
18
19
  rpcGateway
19
20
  } = useSPAContext();
20
21
  const langAsync = useAsync(async () => {
21
- const {
22
- values
23
- } = await rpcGateway.tags.GetTagValues({
24
- application,
25
- name: 'Language',
26
- platforms
22
+ // GetTagValues caps an unpaged request at 100 values, and apps hold more languages than that
23
+ const values = await collectPaginatedData(1000, async (perPage, page) => {
24
+ const res = await rpcGateway.tags.GetTagValues({
25
+ application,
26
+ name: 'Language',
27
+ platforms,
28
+ page,
29
+ perPage
30
+ });
31
+ return res.values;
27
32
  });
28
33
  const valuesLangCodes = values.map(v => canonicalizeLangCode(v.value));
29
34
  const allLangCodes = Array.from(new Set([...valuesLangCodes, ...langCodes.map(canonicalizeLangCode)]).values());
package/package.json CHANGED
@@ -55,5 +55,5 @@
55
55
  "react": "^16.14.0 || ^18.0.0",
56
56
  "react-dom": "^16.14.0 || ^18.0.0"
57
57
  },
58
- "version": "1.3.27"
58
+ "version": "1.3.28"
59
59
  }