@lancom/shared 0.0.407 → 0.0.408

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/store/index.js +6 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lancom/shared",
3
- "version": "0.0.407",
3
+ "version": "0.0.408",
4
4
  "description": "lancom common scripts",
5
5
  "author": "e.tokovenko <e.tokovenko@gmail.com>",
6
6
  "repository": {
package/store/index.js CHANGED
@@ -54,7 +54,7 @@ export const getters = {
54
54
  };
55
55
 
56
56
  export const actions = {
57
- async nuxtClientInit({ commit }, context) {
57
+ async nuxtClientInit({ commit, state: { shop } }, context) {
58
58
  try {
59
59
  const auth = getAuthToken();
60
60
  if (auth) {
@@ -63,6 +63,11 @@ export const actions = {
63
63
  } catch (e) {
64
64
  console.log('nuxtClientInit: ', e);
65
65
  }
66
+
67
+ if (!shop._id) {
68
+ shop = await api.fetchShopByUrl(process.env.HOST_NAME);
69
+ await commit('setShop', shop);
70
+ }
66
71
  },
67
72
  async nuxtServerInit({ commit }, { req }) {
68
73
  const shop = await api.fetchShopByUrl(process.env.HOST_NAME);