@applicaster/quick-brick-core 13.0.0-rc.13 → 13.0.0-rc.14

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.
@@ -19,3 +19,5 @@ export const TYPE_KEYS = [
19
19
  "layout",
20
20
  "pipesEndpoints",
21
21
  ];
22
+
23
+ export const ACTIVE_LAYOUT_ID_STORAGE_KEY = "active_layout_id";
@@ -1,5 +1,5 @@
1
1
  import * as R from "ramda";
2
- import { Dimensions } from "react-native";
2
+ import { Dimensions, NativeModules } from "react-native";
3
3
  import { loadAppContextData } from "@applicaster/zapp-react-native-redux";
4
4
  import { isTablet } from "@applicaster/zapp-react-native-utils/reactHooks";
5
5
  import { mapPromises } from "@applicaster/zapp-react-native-utils/arrayUtils";
@@ -7,6 +7,9 @@ import { fetchPluginConfiguration, getPromiseForType } from "../helpers";
7
7
  import { cacheAssets } from "../../AssetCache";
8
8
  import { actions as appDataActions } from "@applicaster/zapp-react-native-redux/AppData";
9
9
  import { logger } from "@applicaster/zapp-react-native-utils/logger";
10
+ import { ACTIVE_LAYOUT_ID_STORAGE_KEY } from "../consts";
11
+ const { AppLoaderBridge } = NativeModules;
12
+ import { localStorage } from "@applicaster/zapp-react-native-bridge/ZappStorage/LocalStorage";
10
13
 
11
14
  export async function getNativeRemoteContextData(
12
15
  dispatch,
@@ -33,11 +36,19 @@ export async function getNativeRemoteContextData(
33
36
  R.pathSatisfies(R.is(Function), ["module", "selectLayout"])
34
37
  )(plugins);
35
38
 
36
- await layoutManagerPlugin?.module?.selectLayout({
37
- runtimeConfigurationUrls,
38
- plugin: layoutManagerPlugin,
39
- isTablet: isTabletDevice,
40
- });
39
+ if (layoutManagerPlugin) {
40
+ await layoutManagerPlugin.module?.selectLayout({
41
+ runtimeConfigurationUrls,
42
+ plugin: layoutManagerPlugin,
43
+ isTablet: isTabletDevice,
44
+ });
45
+ } else {
46
+ const layoutId = await localStorage.getItem(ACTIVE_LAYOUT_ID_STORAGE_KEY);
47
+
48
+ if (layoutId) {
49
+ await AppLoaderBridge?.switchLayout(layoutId, null);
50
+ }
51
+ }
41
52
  } catch (error) {
42
53
  logger.error({
43
54
  message: "Error selecting layout using layout manager plugin",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applicaster/quick-brick-core",
3
- "version": "13.0.0-rc.13",
3
+ "version": "13.0.0-rc.14",
4
4
  "description": "Core package for Applicaster's Quick Brick App",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -29,13 +29,13 @@
29
29
  },
30
30
  "homepage": "https://github.com/applicaster/quickbrick#readme",
31
31
  "dependencies": {
32
- "@applicaster/applicaster-types": "13.0.0-rc.13",
33
- "@applicaster/quick-brick-core-plugins": "13.0.0-rc.13",
34
- "@applicaster/zapp-pipes-v2-client": "13.0.0-rc.13",
35
- "@applicaster/zapp-react-native-bridge": "13.0.0-rc.13",
36
- "@applicaster/zapp-react-native-redux": "13.0.0-rc.13",
37
- "@applicaster/zapp-react-native-ui-components": "13.0.0-rc.13",
38
- "@applicaster/zapp-react-native-utils": "13.0.0-rc.13",
32
+ "@applicaster/applicaster-types": "13.0.0-rc.14",
33
+ "@applicaster/quick-brick-core-plugins": "13.0.0-rc.14",
34
+ "@applicaster/zapp-pipes-v2-client": "13.0.0-rc.14",
35
+ "@applicaster/zapp-react-native-bridge": "13.0.0-rc.14",
36
+ "@applicaster/zapp-react-native-redux": "13.0.0-rc.14",
37
+ "@applicaster/zapp-react-native-ui-components": "13.0.0-rc.14",
38
+ "@applicaster/zapp-react-native-utils": "13.0.0-rc.14",
39
39
  "atob": "^2.1.2",
40
40
  "axios": "^0.28.0",
41
41
  "btoa": "^1.2.1",