@contentful/field-editor-reference 5.30.5 → 5.30.7
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/dist/cjs/components/ScheduledIconWithTooltip/ScheduledIconWithTooltip.js +16 -8
- package/dist/cjs/entries/WrappedEntryCard/WrappedEntryCard.js +10 -2
- package/dist/esm/components/ScheduledIconWithTooltip/ScheduledIconWithTooltip.js +16 -8
- package/dist/esm/entries/WrappedEntryCard/WrappedEntryCard.js +10 -2
- package/package.json +5 -6
|
@@ -64,17 +64,25 @@ function useScheduledActions({ getEntityScheduledActions, entityId, entityType }
|
|
|
64
64
|
type: 'loading'
|
|
65
65
|
});
|
|
66
66
|
_react.useEffect(()=>{
|
|
67
|
+
let mounted = true;
|
|
67
68
|
getEntityScheduledActions(entityType, entityId).then((data)=>{
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
69
|
+
if (mounted) {
|
|
70
|
+
setStatus({
|
|
71
|
+
type: 'loaded',
|
|
72
|
+
jobs: data
|
|
73
|
+
});
|
|
74
|
+
}
|
|
72
75
|
}).catch((e)=>{
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
76
|
+
if (mounted) {
|
|
77
|
+
setStatus({
|
|
78
|
+
type: 'error',
|
|
79
|
+
error: e
|
|
80
|
+
});
|
|
81
|
+
}
|
|
77
82
|
});
|
|
83
|
+
return ()=>{
|
|
84
|
+
mounted = false;
|
|
85
|
+
};
|
|
78
86
|
}, []);
|
|
79
87
|
if (status.type === 'loading') {
|
|
80
88
|
return {
|
|
@@ -65,6 +65,7 @@ function WrappedEntryCard(props) {
|
|
|
65
65
|
const [file, setFile] = _react.useState(null);
|
|
66
66
|
const { contentType } = props;
|
|
67
67
|
_react.useEffect(()=>{
|
|
68
|
+
let mounted = true;
|
|
68
69
|
if (props.entry) {
|
|
69
70
|
getEntryImage({
|
|
70
71
|
entry: props.entry,
|
|
@@ -72,11 +73,18 @@ function WrappedEntryCard(props) {
|
|
|
72
73
|
localeCode: props.localeCode,
|
|
73
74
|
defaultLocaleCode: props.defaultLocaleCode
|
|
74
75
|
}, props.getAsset).then((file)=>{
|
|
75
|
-
|
|
76
|
+
if (mounted) {
|
|
77
|
+
setFile(file);
|
|
78
|
+
}
|
|
76
79
|
}).catch(()=>{
|
|
77
|
-
|
|
80
|
+
if (mounted) {
|
|
81
|
+
setFile(null);
|
|
82
|
+
}
|
|
78
83
|
});
|
|
79
84
|
}
|
|
85
|
+
return ()=>{
|
|
86
|
+
mounted = false;
|
|
87
|
+
};
|
|
80
88
|
}, [
|
|
81
89
|
props.entry,
|
|
82
90
|
props.getAsset,
|
|
@@ -5,17 +5,25 @@ export function useScheduledActions({ getEntityScheduledActions, entityId, entit
|
|
|
5
5
|
type: 'loading'
|
|
6
6
|
});
|
|
7
7
|
React.useEffect(()=>{
|
|
8
|
+
let mounted = true;
|
|
8
9
|
getEntityScheduledActions(entityType, entityId).then((data)=>{
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
if (mounted) {
|
|
11
|
+
setStatus({
|
|
12
|
+
type: 'loaded',
|
|
13
|
+
jobs: data
|
|
14
|
+
});
|
|
15
|
+
}
|
|
13
16
|
}).catch((e)=>{
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
17
|
+
if (mounted) {
|
|
18
|
+
setStatus({
|
|
19
|
+
type: 'error',
|
|
20
|
+
error: e
|
|
21
|
+
});
|
|
22
|
+
}
|
|
18
23
|
});
|
|
24
|
+
return ()=>{
|
|
25
|
+
mounted = false;
|
|
26
|
+
};
|
|
19
27
|
}, []);
|
|
20
28
|
if (status.type === 'loading') {
|
|
21
29
|
return {
|
|
@@ -14,6 +14,7 @@ export function WrappedEntryCard(props) {
|
|
|
14
14
|
const [file, setFile] = React.useState(null);
|
|
15
15
|
const { contentType } = props;
|
|
16
16
|
React.useEffect(()=>{
|
|
17
|
+
let mounted = true;
|
|
17
18
|
if (props.entry) {
|
|
18
19
|
getEntryImage({
|
|
19
20
|
entry: props.entry,
|
|
@@ -21,11 +22,18 @@ export function WrappedEntryCard(props) {
|
|
|
21
22
|
localeCode: props.localeCode,
|
|
22
23
|
defaultLocaleCode: props.defaultLocaleCode
|
|
23
24
|
}, props.getAsset).then((file)=>{
|
|
24
|
-
|
|
25
|
+
if (mounted) {
|
|
26
|
+
setFile(file);
|
|
27
|
+
}
|
|
25
28
|
}).catch(()=>{
|
|
26
|
-
|
|
29
|
+
if (mounted) {
|
|
30
|
+
setFile(null);
|
|
31
|
+
}
|
|
27
32
|
});
|
|
28
33
|
}
|
|
34
|
+
return ()=>{
|
|
35
|
+
mounted = false;
|
|
36
|
+
};
|
|
29
37
|
}, [
|
|
30
38
|
props.entry,
|
|
31
39
|
props.getAsset,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentful/field-editor-reference",
|
|
3
|
-
"version": "5.30.
|
|
3
|
+
"version": "5.30.7",
|
|
4
4
|
"main": "dist/cjs/index.js",
|
|
5
5
|
"module": "dist/esm/index.js",
|
|
6
6
|
"types": "dist/types/index.d.ts",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"@contentful/f36-components": "^4.67.0",
|
|
39
39
|
"@contentful/f36-icons": "^4.28.2",
|
|
40
40
|
"@contentful/f36-tokens": "^4.0.5",
|
|
41
|
-
"@contentful/field-editor-shared": "^1.6.
|
|
41
|
+
"@contentful/field-editor-shared": "^1.6.1",
|
|
42
42
|
"@contentful/mimetype": "^2.2.29",
|
|
43
43
|
"@dnd-kit/core": "^6.0.8",
|
|
44
44
|
"@dnd-kit/modifiers": "^7.0.0",
|
|
@@ -50,12 +50,11 @@
|
|
|
50
50
|
"lodash": "^4.17.15",
|
|
51
51
|
"moment": "^2.20.0",
|
|
52
52
|
"p-queue": "^4.0.0",
|
|
53
|
-
"react-intersection-observer": "9.4.0"
|
|
54
|
-
"type-fest": "2.17.0"
|
|
53
|
+
"react-intersection-observer": "9.4.0"
|
|
55
54
|
},
|
|
56
55
|
"devDependencies": {
|
|
57
56
|
"@contentful/app-sdk": "^4.29.0",
|
|
58
|
-
"@contentful/field-editor-test-utils": "^1.5.
|
|
57
|
+
"@contentful/field-editor-test-utils": "^1.5.1",
|
|
59
58
|
"@testing-library/react-hooks": "^8.0.1"
|
|
60
59
|
},
|
|
61
60
|
"peerDependencies": {
|
|
@@ -65,5 +64,5 @@
|
|
|
65
64
|
"publishConfig": {
|
|
66
65
|
"registry": "https://npm.pkg.github.com/"
|
|
67
66
|
},
|
|
68
|
-
"gitHead": "
|
|
67
|
+
"gitHead": "bf075c88a35535dd9ac930e40b49036beac98d90"
|
|
69
68
|
}
|