tycho-components 0.0.15-SNAPSHOT-4 → 0.0.15-SNAPSHOT-5

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.
@@ -14,6 +14,11 @@ export default function HeaderCorpora({ navigateCorpora, redirect, autoload, fre
14
14
  const [corpora, setCorpora] = useState([]);
15
15
  const [openCorpora, setOpenCorpora] = useState(false);
16
16
  const load = () => {
17
+ CorpusService.available().then((r) => {
18
+ setCorpora(r.data);
19
+ });
20
+ };
21
+ const loadAndApply = () => {
17
22
  CorpusService.available().then((r) => {
18
23
  setCorpora(r.data);
19
24
  if (uid) {
@@ -49,7 +54,7 @@ export default function HeaderCorpora({ navigateCorpora, redirect, autoload, fre
49
54
  openCorpora && load();
50
55
  }, [openCorpora]);
51
56
  useEffect(() => {
52
- autoload && load();
57
+ autoload && loadAndApply();
53
58
  }, [autoload]);
54
59
  return (_jsxs("div", { className: "header-corpora-container", children: [hasCorpus() && (_jsxs("div", { className: "corpus-container", onClick: handleCorpusClick, children: [_jsx(AppPicture, { src: getCorpus().picture, title: getCorpus().name, className: "avatar" }), _jsx("span", { children: getCorpus().name })] })), openCorpora && (_jsx(AppModal, { className: "modal-corpora", title: t('label.choose'), close: () => setOpenCorpora(false), children: corpora.map((corpus) => (_jsxs("div", { className: "item", onClick: () => handleChooseCorpus(corpus), children: [_jsx(AppPicture, { src: corpus.picture, title: corpus.name, className: "avatar" }), _jsx("span", { children: corpus.name })] }, corpus.uid))) }))] }));
55
60
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "tycho-components",
3
3
  "private": false,
4
- "version": "0.0.15-SNAPSHOT-4",
4
+ "version": "0.0.15-SNAPSHOT-5",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "exports": {