gatsby-theme-q3 3.2.4 → 3.2.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.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,17 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [3.2.5](https://github.com/3merge/q/compare/v3.2.4...v3.2.5) (2022-02-11)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * subdomain detection in production ([c7d91ca](https://github.com/3merge/q/commit/c7d91ca8a694335fc5fc13888a529755d718ce3c))
12
+
13
+
14
+
15
+
16
+
6
17
  ## [3.2.4](https://github.com/3merge/q/compare/v3.2.3...v3.2.4) (2022-02-10)
7
18
 
8
19
 
package/gatsby-browser.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import axios from 'axios';
2
- import { last, size } from 'lodash';
2
+ import { size } from 'lodash';
3
3
  import { getDomain } from 'q3-admin';
4
4
  import { browser } from 'q3-ui-helpers';
5
5
 
@@ -22,11 +22,12 @@ export const onClientEntry = async () => {
22
22
 
23
23
  // set tenant default
24
24
  const { host } = window.location;
25
- const parts = String(host).split('.').reverse();
25
+ const str = String(host);
26
+ const offset = str.includes('localhost') ? -1 : -2;
27
+ const parts = str.split('.').slice(0, offset).join('.');
26
28
 
27
- if (size(parts) > 1)
28
- axios.defaults.headers['X-Session-Tenant'] =
29
- last(parts);
29
+ if (size(parts))
30
+ axios.defaults.headers['X-Session-Tenant'] = parts;
30
31
 
31
32
  // calls Q3 API
32
33
  await getDomain();
package/gatsby-config.js CHANGED
@@ -12,7 +12,7 @@ module.exports = (options) => {
12
12
  },
13
13
  'gatsby-plugin-material-ui',
14
14
  'gatsby-plugin-force-trailing-slashes',
15
- 'gatsby-plugin-sitemap',
15
+ // 'gatsby-plugin-sitemap',
16
16
  {
17
17
  resolve: 'gatsby-transformer-sharp',
18
18
  options: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gatsby-theme-q3",
3
- "version": "3.2.4",
3
+ "version": "3.2.5",
4
4
  "main": "index.js",
5
5
  "license": "MIT",
6
6
  "peerDependencies": {
@@ -42,5 +42,5 @@
42
42
  "transform-loader": "^0.2.4",
43
43
  "yarn": "^1.22.17"
44
44
  },
45
- "gitHead": "5ca604e4b9081cf5728a581bc0a7300ffcefb6e9"
45
+ "gitHead": "491dbd6d8280a171288f7054f6e29261c530a53c"
46
46
  }