@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 +6 -0
- package/dist/cjs/state/hooks/usePrefetch.js +8 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/state/hooks/usePrefetch.js +7 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/state/hooks/usePrefetch.js +7 -1
- package/dist/esm/version.json +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -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;
|
package/dist/cjs/version.json
CHANGED
|
@@ -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
|
package/dist/es2019/version.json
CHANGED
|
@@ -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;
|
package/dist/esm/version.json
CHANGED