@etsoo/react 1.5.3 → 1.5.7

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.
@@ -1,4 +1,4 @@
1
- import { createClient } from '@etsoo/appscript';
1
+ import { BridgeUtils, createClient } from '@etsoo/appscript';
2
2
  import { DomUtils } from '@etsoo/shared';
3
3
  import { CoreConstants } from './CoreConstants';
4
4
  import { ReactApp } from './ReactApp';
@@ -44,16 +44,14 @@ export class ServiceApp extends ReactApp {
44
44
  * @param tryLogin Try to login again
45
45
  */
46
46
  toLoginPage(tryLogin) {
47
- const coreUrl = this.settings.webUrl;
48
- window.location.href =
49
- coreUrl +
50
- '?serviceId=' +
51
- this.settings.serviceId +
52
- '&' +
53
- DomUtils.CultureField +
54
- '=' +
55
- this.culture +
56
- (tryLogin ? '' : '&tryLogin=false');
47
+ const parameters = `?serviceId=${this.settings.serviceId}&${DomUtils.CultureField}=${this.culture}${tryLogin ? '' : '&tryLogin=false'}`;
48
+ if (BridgeUtils.host == null) {
49
+ const coreUrl = this.settings.webUrl;
50
+ window.location.href = coreUrl + parameters;
51
+ }
52
+ else {
53
+ BridgeUtils.host.loadApp('core', parameters);
54
+ }
57
55
  }
58
56
  /**
59
57
  * Refresh token
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/react",
3
- "version": "1.5.3",
3
+ "version": "1.5.7",
4
4
  "description": "TypeScript ReactJs framework",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -50,7 +50,7 @@
50
50
  "@emotion/react": "^11.7.1",
51
51
  "@emotion/style": "^0.8.0",
52
52
  "@emotion/styled": "^11.6.0",
53
- "@etsoo/appscript": "^1.2.43",
53
+ "@etsoo/appscript": "^1.2.46",
54
54
  "@etsoo/notificationbase": "^1.1.1",
55
55
  "@etsoo/shared": "^1.1.11",
56
56
  "@mui/icons-material": "^5.4.1",
@@ -1,4 +1,5 @@
1
1
  import {
2
+ BridgeUtils,
2
3
  createClient,
3
4
  IApi,
4
5
  IApiPayload,
@@ -72,16 +73,16 @@ export class ServiceApp<
72
73
  * @param tryLogin Try to login again
73
74
  */
74
75
  override toLoginPage(tryLogin?: boolean) {
75
- const coreUrl = this.settings.webUrl;
76
- window.location.href =
77
- coreUrl +
78
- '?serviceId=' +
79
- this.settings.serviceId +
80
- '&' +
81
- DomUtils.CultureField +
82
- '=' +
83
- this.culture +
84
- (tryLogin ? '' : '&tryLogin=false');
76
+ const parameters = `?serviceId=${this.settings.serviceId}&${
77
+ DomUtils.CultureField
78
+ }=${this.culture}${tryLogin ? '' : '&tryLogin=false'}`;
79
+
80
+ if (BridgeUtils.host == null) {
81
+ const coreUrl = this.settings.webUrl;
82
+ window.location.href = coreUrl + parameters;
83
+ } else {
84
+ BridgeUtils.host.loadApp('core', parameters);
85
+ }
85
86
  }
86
87
 
87
88
  /**