From f334df409f9657d8b03d7fdce0a020249a2f4753 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BB=D0=BC=D0=B0=D0=B7=20=D0=93=D0=B0=D1=82=D0=B0?= =?UTF-8?q?=D1=83=D0=BB=D0=BB=D0=B8=D0=BD?= Date: Wed, 19 Jun 2024 15:36:33 +0300 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20=D0=B8=D1=81=D0=BF=D1=80=D0=B0=D0=B2?= =?UTF-8?q?=D0=BB=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=BF=D1=80=D0=B8=D0=BC=D0=B5?= =?UTF-8?q?=D1=80=D0=B0=20=D0=B4=D0=BB=D1=8F=20=D0=BF=D1=80=D0=BE=D0=B2?= =?UTF-8?q?=D0=B5=D1=80=D0=BA=D0=B8=20=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D1=8B?= =?UTF-8?q?=20=D0=BA=D0=BE=D0=BC=D0=BF=D0=BE=D0=BD=D0=B5=D0=BD=D1=82=D1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.js | 13 ++++++++++++- .../performed-work-details-grid.tsx | 2 +- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 0abeaae..9bd82ea 100644 --- a/index.js +++ b/index.js @@ -4,4 +4,15 @@ import api from './host-api-stub'; import context from './host-context-stub'; import loadApp from './src/loaders/performed-work-details-grid-card-loader'; -loadApp(document.getElementById('app'), context, api); +let args = { + /** Контейнер. */ + container: document.getElementById('app'), + /** Контекст инициализации. */ + initialContext: null, + /** API сторонних компонентов. */ + api: api, + /** Параметры стороннего контрола.*/ + controlInfo: null +} + +loadApp(args); diff --git a/src/controls/performed-work-details-grid/performed-work-details-grid.tsx b/src/controls/performed-work-details-grid/performed-work-details-grid.tsx index d6c92c0..642e275 100644 --- a/src/controls/performed-work-details-grid/performed-work-details-grid.tsx +++ b/src/controls/performed-work-details-grid/performed-work-details-grid.tsx @@ -23,7 +23,7 @@ const PerformedWorkDetailsGrid: React.FC = ({ initialContext, api }) => const [ context, setContext ] = React.useState(initialContext); // Задаем локализацию внутри контрола в соответствии с локализацией в контексте, в котором находится контрол. - const currentCulture = context.currentCulture ?? DEFAULT_CULTURE; + const currentCulture = context?.currentCulture ?? DEFAULT_CULTURE; const { i18n } = useTranslation(); React.useEffect(() => { i18n.changeLanguage(currentCulture); From 50cf5d05851f164726c55edc734449795458779b Mon Sep 17 00:00:00 2001 From: AlmazGataullin <89449219+AlmazGataullin@users.noreply.github.com> Date: Wed, 18 Sep 2024 10:26:08 +0300 Subject: [PATCH 2/2] Update index.js --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 9bd82ea..1faa1fb 100644 --- a/index.js +++ b/index.js @@ -8,7 +8,7 @@ let args = { /** Контейнер. */ container: document.getElementById('app'), /** Контекст инициализации. */ - initialContext: null, + initialContext: context, /** API сторонних компонентов. */ api: api, /** Параметры стороннего контрола.*/