cozy-ui 68.5.0 → 68.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
+ ## [68.5.1](https://github.com/cozy/cozy-ui/compare/v68.5.0...v68.5.1) (2022-06-17)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * Reduce console spam by AppLinker ([27d9064](https://github.com/cozy/cozy-ui/commit/27d9064))
7
+
1
8
  # [68.5.0](https://github.com/cozy/cozy-ui/compare/v68.4.0...v68.5.0) (2022-06-08)
2
9
 
3
10
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cozy-ui",
3
- "version": "68.5.0",
3
+ "version": "68.5.1",
4
4
  "description": "Cozy apps UI SDK",
5
5
  "main": "./index.js",
6
6
  "bin": {
@@ -87,25 +87,23 @@ export class AppLinker extends React.Component {
87
87
  const appInfo = NATIVE_APP_INFOS[slug]
88
88
 
89
89
  if (isFlagshipApp()) {
90
- if (!context)
91
- logger.warn(
92
- 'FlagshipApp detected but no context found. Is the app wrapped in <WebviewIntentProvider? />'
93
- )
94
-
95
- if (context) {
96
- const imgPayload =
97
- imgRef &&
98
- JSON.stringify({
99
- ...imgRef.getBoundingClientRect().toJSON()
100
- })
101
-
102
- return {
103
- onClick: event => {
104
- event.preventDefault()
105
- context.call('openApp', href, app, imgPayload)
106
- },
107
- href: '#'
108
- }
90
+ const imgPayload =
91
+ imgRef &&
92
+ JSON.stringify({
93
+ ...imgRef.getBoundingClientRect().toJSON()
94
+ })
95
+
96
+ return {
97
+ onClick: event => {
98
+ event.preventDefault()
99
+
100
+ context
101
+ ? context.call('openApp', href, app, imgPayload)
102
+ : logger.error(
103
+ `Failed to "openApp(${app})". WebviewService has the following falsy value "${context}" in AppLinker's context.`
104
+ )
105
+ },
106
+ href: '#'
109
107
  }
110
108
  }
111
109
 
@@ -158,18 +158,14 @@ export var AppLinker = /*#__PURE__*/function (_React$Component) {
158
158
  var appInfo = NATIVE_APP_INFOS[slug];
159
159
 
160
160
  if (isFlagshipApp()) {
161
- if (!context) logger.warn('FlagshipApp detected but no context found. Is the app wrapped in <WebviewIntentProvider? />');
162
-
163
- if (context) {
164
- var imgPayload = imgRef && JSON.stringify(_objectSpread({}, imgRef.getBoundingClientRect().toJSON()));
165
- return {
166
- onClick: function onClick(event) {
167
- event.preventDefault();
168
- context.call('openApp', href, app, imgPayload);
169
- },
170
- href: '#'
171
- };
172
- }
161
+ var imgPayload = imgRef && JSON.stringify(_objectSpread({}, imgRef.getBoundingClientRect().toJSON()));
162
+ return {
163
+ onClick: function onClick(event) {
164
+ event.preventDefault();
165
+ context ? context.call('openApp', href, app, imgPayload) : logger.error("Failed to \"openApp(".concat(app, ")\". WebviewService has the following falsy value \"").concat(context, "\" in AppLinker's context."));
166
+ },
167
+ href: '#'
168
+ };
173
169
  }
174
170
 
175
171
  if (usingNativeApp) {