@applicaster/zapp-react-native-utils 15.1.0-rc.7 → 15.1.0-rc.9

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.
@@ -90,7 +90,7 @@ export function HooksManager({
90
90
  }: HookManagerArgs): HookManager {
91
91
  hooksManagerLogger.addContext({ targetScreenId: targetScreen.id });
92
92
 
93
- function logHookEvent(func, message, data) {
93
+ function logHookEvent(func, message, data = {}) {
94
94
  func({
95
95
  message,
96
96
  data: __DEV__ ? data : null,
@@ -347,7 +347,6 @@ export function HooksManager({
347
347
  `hookCallback: send app to background, cancelled flow blocker hook ${hookPlugin["identifier"]} on home screen`,
348
348
  {
349
349
  payload,
350
- hook: hookPlugin,
351
350
  }
352
351
  );
353
352
 
@@ -362,17 +361,13 @@ export function HooksManager({
362
361
  `hookCallback: hook successfully finished: ${hookPlugin["identifier"]}`,
363
362
  {
364
363
  payload,
365
- hook: hookPlugin,
366
364
  }
367
365
  );
368
366
 
369
367
  if (!callback) {
370
368
  logHookEvent(
371
- hooksManagerLogger.warn,
372
- `hookCallback: ${hookPlugin["identifier"]} is missing \`callback\`, using hookCallback(default one)`,
373
- {
374
- hookPlugin,
375
- }
369
+ hooksManagerLogger.debug,
370
+ `hookCallback: ${hookPlugin.identifier} is missing \`callback\`, using hookCallback(default one)`
376
371
  );
377
372
 
378
373
  callback = hookCallback;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applicaster/zapp-react-native-utils",
3
- "version": "15.1.0-rc.7",
3
+ "version": "15.1.0-rc.9",
4
4
  "description": "Applicaster Zapp React Native utilities package",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -27,7 +27,7 @@
27
27
  },
28
28
  "homepage": "https://github.com/applicaster/quickbrick#readme",
29
29
  "dependencies": {
30
- "@applicaster/applicaster-types": "15.1.0-rc.7",
30
+ "@applicaster/applicaster-types": "15.1.0-rc.9",
31
31
  "buffer": "^5.2.1",
32
32
  "camelize": "^1.0.0",
33
33
  "dayjs": "^1.11.10",
@@ -37,7 +37,7 @@ export function isLiveLegacy(content) {
37
37
  ]);
38
38
 
39
39
  const durationFromExt = R.path(["extensions", "duration"], content);
40
- const durationFromMgr = playerManager.getDuration();
40
+ const durationFromMgr = playerManager.getInstanceController()?.getDuration();
41
41
  const duration = Math.floor(durationFromExt || durationFromMgr);
42
42
 
43
43
  const isLive = R.anyPass([isNotaValidNumber, R.lte(R.__, 0)])(duration);
@@ -81,7 +81,9 @@ function isLiveByManager(): boolean {
81
81
  return true;
82
82
  }
83
83
 
84
- const durationFromPlayerManager = playerManager.getDuration();
84
+ const durationFromPlayerManager = playerManager
85
+ .getInstanceController()
86
+ ?.getDuration();
85
87
 
86
88
  return isLiveByDuration(durationFromPlayerManager);
87
89
  }
@@ -2,6 +2,12 @@ import React from "react";
2
2
  import { useContentTypes } from "@applicaster/zapp-react-native-redux/hooks";
3
3
  import { useNavigation } from "@applicaster/zapp-react-native-utils/reactHooks";
4
4
  import { useRivers } from "../../state";
5
+ import { createLogger } from "../../../logger";
6
+
7
+ const { log_warning } = createLogger({
8
+ subsystem: "zapp-react-native-utils/reactHooks/videoModal",
9
+ category: "useVideoModalScreenData",
10
+ });
5
11
 
6
12
  export const useVideoModalScreenData = ():
7
13
  | (ZappEntry & { targetScreen: any }) // TODO: fix ZappEntry type ( was ZappRiver but conflict )
@@ -14,10 +20,22 @@ export const useVideoModalScreenData = ():
14
20
  const rivers = useRivers();
15
21
 
16
22
  return React.useMemo(() => {
17
- if (item?.type?.value) {
18
- const screenId = contentTypes[item?.type?.value].screen_id;
23
+ const itemType = item?.type?.value;
24
+
25
+ if (!itemType) {
26
+ return;
27
+ }
19
28
 
20
- return { ...item, targetScreen: rivers?.[screenId] };
29
+ const screenId = contentTypes[itemType]?.screen_id;
30
+
31
+ if (!screenId) {
32
+ log_warning(
33
+ `Type mapping is missing for item type: ${itemType}, title: ${item.title}`
34
+ );
35
+
36
+ return;
21
37
  }
22
- }, [item]);
38
+
39
+ return { ...item, targetScreen: rivers?.[screenId] };
40
+ }, [contentTypes, item, rivers]);
23
41
  };