@atlaskit/smart-card 20.1.3 → 20.1.4

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,5 +1,11 @@
1
1
  # @atlaskit/smart-card
2
2
 
3
+ ## 20.1.4
4
+
5
+ ### Patch Changes
6
+
7
+ - [`8df009f4313`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8df009f4313) - fix metadata status for prefetching
8
+
3
9
  ## 20.1.3
4
10
 
5
11
  ### Patch Changes
@@ -15,6 +15,8 @@ var _react = require("react");
15
15
 
16
16
  var _linkProvider = require("@atlaskit/link-provider");
17
17
 
18
+ var _linkingCommon = require("@atlaskit/linking-common");
19
+
18
20
  function usePrefetch(url) {
19
21
  var _useSmartLinkContext = (0, _linkProvider.useSmartLinkContext)(),
20
22
  store = _useSmartLinkContext.store,
@@ -70,7 +72,12 @@ function usePrefetch(url) {
70
72
  type: 'resolved',
71
73
  url: url,
72
74
  payload: response
73
- });
75
+ }); // Put the metadata in resolved state, theres no need for a pending or errored state as
76
+ // we are following the same render flow as described by the comments above and below.
77
+
78
+ dispatch((0, _linkingCommon.cardAction)(_linkingCommon.ACTION_UPDATE_METADATA_STATUS, {
79
+ url: url
80
+ }, undefined, undefined, 'resolved'));
74
81
  }
75
82
 
76
83
  _context.next = 14;
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-card",
3
- "version": "20.1.3",
3
+ "version": "20.1.4",
4
4
  "sideEffects": false
5
5
  }
@@ -1,5 +1,6 @@
1
1
  import { useCallback } from 'react';
2
2
  import { useSmartLinkContext } from '@atlaskit/link-provider';
3
+ import { ACTION_UPDATE_METADATA_STATUS, cardAction } from '@atlaskit/linking-common';
3
4
  export function usePrefetch(url) {
4
5
  const {
5
6
  store,
@@ -45,7 +46,12 @@ export function usePrefetch(url) {
45
46
  type: 'resolved',
46
47
  url,
47
48
  payload: response
48
- });
49
+ }); // Put the metadata in resolved state, theres no need for a pending or errored state as
50
+ // we are following the same render flow as described by the comments above and below.
51
+
52
+ dispatch(cardAction(ACTION_UPDATE_METADATA_STATUS, {
53
+ url
54
+ }, undefined, undefined, 'resolved'));
49
55
  }
50
56
  } catch (_err) {// Do nothing, link will be retried under the hood with exponential backoff.
51
57
  // If it does not succeed even after those retries, the normal resolve flow
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-card",
3
- "version": "20.1.3",
3
+ "version": "20.1.4",
4
4
  "sideEffects": false
5
5
  }
@@ -2,6 +2,7 @@ import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
2
2
  import _regeneratorRuntime from "@babel/runtime/regenerator";
3
3
  import { useCallback } from 'react';
4
4
  import { useSmartLinkContext } from '@atlaskit/link-provider';
5
+ import { ACTION_UPDATE_METADATA_STATUS, cardAction } from '@atlaskit/linking-common';
5
6
  export function usePrefetch(url) {
6
7
  var _useSmartLinkContext = useSmartLinkContext(),
7
8
  store = _useSmartLinkContext.store,
@@ -57,7 +58,12 @@ export function usePrefetch(url) {
57
58
  type: 'resolved',
58
59
  url: url,
59
60
  payload: response
60
- });
61
+ }); // Put the metadata in resolved state, theres no need for a pending or errored state as
62
+ // we are following the same render flow as described by the comments above and below.
63
+
64
+ dispatch(cardAction(ACTION_UPDATE_METADATA_STATUS, {
65
+ url: url
66
+ }, undefined, undefined, 'resolved'));
61
67
  }
62
68
 
63
69
  _context.next = 14;
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-card",
3
- "version": "20.1.3",
3
+ "version": "20.1.4",
4
4
  "sideEffects": false
5
5
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-card",
3
- "version": "20.1.3",
3
+ "version": "20.1.4",
4
4
  "description": "Smart card component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"