@truedat/core 8.11.5 → 8.11.6
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@truedat/core",
|
|
3
|
-
"version": "8.11.
|
|
3
|
+
"version": "8.11.6",
|
|
4
4
|
"description": "Truedat Web Core",
|
|
5
5
|
"sideEffects": [
|
|
6
6
|
"**/*.css",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"@testing-library/jest-dom": "^6.6.3",
|
|
58
58
|
"@testing-library/react": "^16.3.0",
|
|
59
59
|
"@testing-library/user-event": "^14.6.1",
|
|
60
|
-
"@truedat/test": "8.11.
|
|
60
|
+
"@truedat/test": "8.11.6",
|
|
61
61
|
"identity-obj-proxy": "^3.0.0",
|
|
62
62
|
"jest": "^29.7.0",
|
|
63
63
|
"redux-saga-test-plan": "^4.0.6"
|
|
@@ -98,5 +98,5 @@
|
|
|
98
98
|
"swr": "^2.3.3",
|
|
99
99
|
"turndown": "^7.2.2"
|
|
100
100
|
},
|
|
101
|
-
"gitHead": "
|
|
101
|
+
"gitHead": "bfd7e4d934a88ec244c45032ca76103f236e9462"
|
|
102
102
|
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import _ from "lodash/fp";
|
|
2
2
|
import PropTypes from "prop-types";
|
|
3
|
+
|
|
4
|
+
import { useEffect, useRef } from "react";
|
|
3
5
|
import { Form, Label } from "semantic-ui-react";
|
|
4
6
|
import { useIntl, FormattedMessage } from "react-intl";
|
|
5
7
|
import { useQuery } from "@apollo/client";
|
|
@@ -119,8 +121,16 @@ export const TemplateSelectorLoader = ({
|
|
|
119
121
|
const { loading, error, data } = useQuery(TEMPLATES_QUERY, {
|
|
120
122
|
fetchPolicy: "cache-and-network",
|
|
121
123
|
variables: { scope, domainIds },
|
|
122
|
-
onCompleted: onLoad,
|
|
123
124
|
});
|
|
125
|
+
|
|
126
|
+
const hasFiredOnLoad = useRef(false);
|
|
127
|
+
useEffect(() => {
|
|
128
|
+
if (data && onLoad && !hasFiredOnLoad.current) {
|
|
129
|
+
hasFiredOnLoad.current = true;
|
|
130
|
+
onLoad(data);
|
|
131
|
+
}
|
|
132
|
+
}, [data, onLoad]);
|
|
133
|
+
|
|
124
134
|
if (error) return null;
|
|
125
135
|
|
|
126
136
|
const templates = data?.templates || emptyTemplates;
|