@intra-mart/smartlime 2.2.0-dev.20250408 → 2.2.0

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.
@@ -15,7 +15,7 @@ const getModuleStorage = async (storageKey) => {
15
15
  const result = JSON.parse(state);
16
16
  return result;
17
17
  };
18
- const createInitialModule = () => {
18
+ const createInitialModules = () => {
19
19
  const initState = MODULE_IDS.reduce((acc, moduleId) => {
20
20
  acc[moduleId] = {
21
21
  moduleId: moduleId,
@@ -37,6 +37,12 @@ const useRequestModule = (baseUrl, setModules) => {
37
37
  }
38
38
  else {
39
39
  const response = await IMFetch('api/smacolow/modules');
40
+ if (response.status === 404) {
41
+ const state = createInitialModules();
42
+ saveModuleStorage(storageKey, state);
43
+ setModules(state);
44
+ return;
45
+ }
40
46
  if (response.status !== 200) {
41
47
  throw new IMTenantError('failed to fetch module status.');
42
48
  }
@@ -50,7 +56,7 @@ const useRequestModule = (baseUrl, setModules) => {
50
56
  others: {},
51
57
  };
52
58
  return acc;
53
- }, createInitialModule());
59
+ }, createInitialModules());
54
60
  saveModuleStorage(storageKey, state);
55
61
  setModules(state);
56
62
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@intra-mart/smartlime",
3
3
  "description": "expoで使用できるintra mart accelplatform SDK",
4
- "version": "2.2.0-dev.20250408",
4
+ "version": "2.2.0",
5
5
  "keywords": [
6
6
  "intra-mart",
7
7
  "AccelPlatform",