@osovitny/anatoly 3.20.11 → 3.20.13

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.
@@ -93,7 +93,6 @@ const AppContextStorageKeys = {
93
93
 
94
94
  Authors:
95
95
  Vadim Osovitny vadim.osovitny@osovitny.com
96
- Anatoly Osovitny anatoly.osovitny@osovitny.com
97
96
 
98
97
  Created:
99
98
  26 Jun 2020
@@ -106,10 +105,16 @@ const AppContextStorageKeys = {
106
105
  </file>
107
106
  */
108
107
  //App
109
- const AppCoreSettings = JSON.parse(
110
108
  //VadimOS: old approach
111
- //((document.getElementById('appCoreSettings')) as HTMLInputElement).getAttribute('data-appcoresettings')
112
- sessionStorage.getItem(SessionStorageKeys.appCoreSettings));
109
+ /*
110
+ export const AppCoreSettings = JSON.parse(
111
+ ((document.getElementById('appCoreSettings')) as HTMLInputElement).getAttribute('data-appcoresettings')
112
+ );
113
+ */
114
+ function getAppCoreSettings() {
115
+ const json = sessionStorage.getItem(SessionStorageKeys.appCoreSettings);
116
+ return json ? JSON.parse(json) : null;
117
+ }
113
118
  function formatUrl(url) {
114
119
  let newUrl = url;
115
120
  if (url) {
@@ -122,6 +127,7 @@ function formatUrl(url) {
122
127
  }
123
128
  return newUrl;
124
129
  }
130
+ let AppCoreSettings = getAppCoreSettings();
125
131
  //WebApp
126
132
  let isDevMode = `${AppCoreSettings?.isDevMode}`;
127
133
  const AppVersion = `${AppCoreSettings?.version}`;
@@ -10230,8 +10236,8 @@ class AppService extends ApiServiceBase {
10230
10236
  stopwatch.stop();
10231
10237
  stopwatch.printElapsedAsMilliseconds();
10232
10238
  if (data) {
10233
- sessionStorage.setItem(SessionStorageKeys.appCoreSettings, data.core);
10234
- sessionStorage.setItem(SessionStorageKeys.appMSALSettings, data.msal);
10239
+ sessionStorage.setItem(SessionStorageKeys.appCoreSettings, JSON.stringify(data.core));
10240
+ sessionStorage.setItem(SessionStorageKeys.appMSALSettings, JSON.stringify(data.msal));
10235
10241
  }
10236
10242
  }));
10237
10243
  }
@@ -10275,8 +10281,8 @@ class AnatolyCoreModule {
10275
10281
  const appService = inject(AppService);
10276
10282
  return lastValueFrom(appService.loadAppInitializerSettings().pipe(map$1(() => {
10277
10283
  //Localization
10278
- const translate = inject(TranslateService);
10279
- const localizationService = inject(LocalizationService);
10284
+ const translate = InjectorInstance.get(TranslateService);
10285
+ const localizationService = InjectorInstance.get(LocalizationService);
10280
10286
  const lang = localizationService.configureSettings(translate);
10281
10287
  return translate.use(lang);
10282
10288
  })));
@@ -10322,8 +10328,8 @@ class AnatolyCoreModule {
10322
10328
  const appService = inject(AppService);
10323
10329
  return lastValueFrom(appService.loadAppInitializerSettings().pipe(map$1(() => {
10324
10330
  //Localization
10325
- const translate = inject(TranslateService);
10326
- const localizationService = inject(LocalizationService);
10331
+ const translate = InjectorInstance.get(TranslateService);
10332
+ const localizationService = InjectorInstance.get(LocalizationService);
10327
10333
  const lang = localizationService.configureSettings(translate);
10328
10334
  return translate.use(lang);
10329
10335
  })));