@contentful/field-editor-reference 5.1.5 → 5.1.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/CHANGELOG.md CHANGED
@@ -3,6 +3,12 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [5.1.6](https://github.com/contentful/field-editors/compare/@contentful/field-editor-reference@5.1.5...@contentful/field-editor-reference@5.1.6) (2022-09-07)
7
+
8
+ ### Bug Fixes
9
+
10
+ - **reference-editor:** accept pubsub messages from alias and non-alias environments ([#1227](https://github.com/contentful/field-editors/issues/1227)) ([2d7d93a](https://github.com/contentful/field-editors/commit/2d7d93a2d3aa089f7ecdfec48c53c7839856ba0d))
11
+
6
12
  ## [5.1.5](https://github.com/contentful/field-editors/compare/@contentful/field-editor-reference@5.1.4...@contentful/field-editor-reference@5.1.5) (2022-09-06)
7
13
 
8
14
  **Note:** Version bump only for package @contentful/field-editor-reference
@@ -2059,6 +2059,9 @@ var _constate = /*#__PURE__*/constate(function useInitServices(props) {
2059
2059
 
2060
2060
  var currentSpaceId = props.sdk.ids.space;
2061
2061
  var currentEnvironmentId = (_props$sdk$ids$enviro = props.sdk.ids.environmentAlias) != null ? _props$sdk$ids$enviro : props.sdk.ids.environment;
2062
+ var environmentIds = React.useMemo(function () {
2063
+ return [props.sdk.ids.environmentAlias, props.sdk.ids.environment];
2064
+ }, [props.sdk.ids.environmentAlias, props.sdk.ids.environment]);
2062
2065
  var queryClient = reactQuery.useQueryClient();
2063
2066
  var queryCache = queryClient.getQueryCache();
2064
2067
  var entityChangeUnsubscribers = React.useRef({});
@@ -2213,9 +2216,9 @@ var _constate = /*#__PURE__*/constate(function useInitServices(props) {
2213
2216
  }, [fetch]);
2214
2217
  var isSameSpaceEntityQueryKey = React.useCallback(function (queryKey) {
2215
2218
  var isEntityKey = isEntityQueryKey(queryKey);
2216
- var isSameSpaceEntityKey = isEntityKey && queryKey[2] === currentSpaceId && queryKey[3] === currentEnvironmentId;
2219
+ var isSameSpaceEntityKey = isEntityKey && queryKey[2] === currentSpaceId && environmentIds.includes(queryKey[3]);
2217
2220
  return isSameSpaceEntityKey;
2218
- }, [currentSpaceId, currentEnvironmentId]); // @ts-expect-error ...
2221
+ }, [currentSpaceId, environmentIds]); // @ts-expect-error ...
2219
2222
 
2220
2223
  // @ts-expect-error ...
2221
2224
  var onEntityChanged = props.sdk.space.onEntityChanged;