@qlibs/utils 1.14.1 → 1.14.3

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.
@@ -7,4 +7,4 @@ export declare function removeUserData(): void;
7
7
  export declare function saveMySubRoles(mySubRoles: object): void;
8
8
  export declare function getMySubRoles(): any;
9
9
  export declare function removeMySubRoles(): void;
10
- export declare function checkIsMyMode(): boolean;
10
+ export declare function checkIsMyMode(mySubRolesData?: any): boolean;
@@ -58,8 +58,8 @@ function getMySubRoles() {
58
58
  function removeMySubRoles() {
59
59
  return localStorage.removeItem(MY_SUB_ROLES);
60
60
  }
61
- function checkIsMyMode() {
62
- const mySubRoles = getMySubRoles();
61
+ function checkIsMyMode(mySubRolesData) {
62
+ const mySubRoles = mySubRolesData ? mySubRolesData : getMySubRoles();
63
63
  if (!mySubRoles) {
64
64
  return false;
65
65
  }
@@ -5,4 +5,5 @@ export declare function injectAxiosInstance(axiosInstance: AxiosInstance, header
5
5
  'X-Device-Id': string;
6
6
  'X-Device-Name': string;
7
7
  'X-App-Version': string;
8
+ 'X-Timezone'?: string;
8
9
  }, Modal: any): AxiosInstance;
@@ -4,6 +4,7 @@ exports.injectAxiosInstance = injectAxiosInstance;
4
4
  const auth_1 = require("./auth");
5
5
  const browser_1 = require("./browser");
6
6
  function injectAxiosInstance(axiosInstance, headers, Modal) {
7
+ const timezone = headers['X-Timezone'];
7
8
  axiosInstance.interceptors.request.use(async (config) => {
8
9
  if (typeof headers === 'object') {
9
10
  config.headers['Content-Type'] =
@@ -12,6 +13,7 @@ function injectAxiosInstance(axiosInstance, headers, Modal) {
12
13
  config.headers['X-Device-Id'] = headers['X-Device-Id'];
13
14
  config.headers['X-Device-Name'] = headers['X-Device-Name'];
14
15
  config.headers['X-App-Version'] = headers['X-App-Version'];
16
+ config.headers['X-Timezone'] = timezone;
15
17
  }
16
18
  else {
17
19
  config.headers['Content-Type'] =
@@ -20,6 +22,7 @@ function injectAxiosInstance(axiosInstance, headers, Modal) {
20
22
  config.headers['X-Device-Id'] = (0, browser_1.getBrowserId)();
21
23
  config.headers['X-Device-Name'] = (0, browser_1.getBrowserName)();
22
24
  config.headers['X-App-Version'] = '0.0.0';
25
+ config.headers['X-Timezone'] = timezone;
23
26
  }
24
27
  config.headers['Authorization'] = 'Bearer ' + (0, auth_1.getToken)();
25
28
  return config;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qlibs/utils",
3
- "version": "1.14.1",
3
+ "version": "1.14.3",
4
4
  "description": "",
5
5
  "author": "QBIT Developer",
6
6
  "license": "MIT",