cozy-ui 58.5.0 → 58.5.1

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
@@ -1,3 +1,10 @@
1
+ ## [58.5.1](https://github.com/cozy/cozy-ui/compare/v58.5.0...v58.5.1) (2022-01-07)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * Handle context flow without undefined return ([68a33ff](https://github.com/cozy/cozy-ui/commit/68a33ff))
7
+
1
8
  # [58.5.0](https://github.com/cozy/cozy-ui/compare/v58.4.1...v58.5.0) (2022-01-07)
2
9
 
3
10
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cozy-ui",
3
- "version": "58.5.0",
3
+ "version": "58.5.1",
4
4
  "description": "Cozy apps UI SDK",
5
5
  "main": "./index.js",
6
6
  "bin": {
@@ -62,13 +62,15 @@ export class AppLinker extends React.Component {
62
62
 
63
63
  if (isFlagshipApp()) {
64
64
  if (!context)
65
- return console.warn(
65
+ console.warn(
66
66
  'FlagshipApp detected but no context found. Is the app wrapped in WebviewIntentProvider?'
67
67
  )
68
68
 
69
- return {
70
- onClick: () => context.call('openApp', href),
71
- href: '#'
69
+ if (context) {
70
+ return {
71
+ onClick: () => context.call('openApp', href),
72
+ href: '#'
73
+ }
72
74
  }
73
75
  }
74
76
 
@@ -119,13 +119,16 @@ export var AppLinker = /*#__PURE__*/function (_React$Component) {
119
119
  var appInfo = NATIVE_APP_INFOS[slug];
120
120
 
121
121
  if (isFlagshipApp()) {
122
- if (!context) return console.warn('FlagshipApp detected but no context found. Is the app wrapped in WebviewIntentProvider?');
123
- return {
124
- onClick: function onClick() {
125
- return context.call('openApp', href);
126
- },
127
- href: '#'
128
- };
122
+ if (!context) console.warn('FlagshipApp detected but no context found. Is the app wrapped in WebviewIntentProvider?');
123
+
124
+ if (context) {
125
+ return {
126
+ onClick: function onClick() {
127
+ return context.call('openApp', href);
128
+ },
129
+ href: '#'
130
+ };
131
+ }
129
132
  }
130
133
 
131
134
  if (usingNativeApp) {