@bigbinary/neeto-themes-frontend 3.1.0 → 3.1.2

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.
@@ -1191,11 +1191,13 @@ var Customize = function Customize(_ref) {
1191
1191
  var _useConfigStore = useConfigStore(function (store) {
1192
1192
  return {
1193
1193
  themePropertiesSchema: store["themePropertiesSchema"],
1194
- entityType: store["entityType"]
1194
+ entityType: store["entityType"],
1195
+ isFetchingSchema: store["isFetchingSchema"]
1195
1196
  };
1196
1197
  }, shallow),
1197
1198
  themePropertiesSchema = _useConfigStore.themePropertiesSchema,
1198
- entityType = _useConfigStore.entityType;
1199
+ entityType = _useConfigStore.entityType,
1200
+ isFetchingSchema = _useConfigStore.isFetchingSchema;
1199
1201
  var _useParams = useParams(),
1200
1202
  themeId = _useParams.themeId;
1201
1203
  var _useThemeStore = useThemeStore(function (store) {
@@ -1217,7 +1219,8 @@ var Customize = function Customize(_ref) {
1217
1219
  }),
1218
1220
  _useFetchTheme$data = _useFetchTheme.data,
1219
1221
  themeData = _useFetchTheme$data === void 0 ? {} : _useFetchTheme$data,
1220
- isLoading = _useFetchTheme.isLoading;
1222
+ isLoadingTheme = _useFetchTheme.isLoadingTheme;
1223
+ var isLoading = isFetchingSchema || isLoadingTheme;
1221
1224
  var isThemeGlobalTheme = themeId && (globalTheme === null || globalTheme === void 0 ? void 0 : globalTheme.id) === themeId;
1222
1225
  var isCurrentThemeAndGlobalThemeSame = (currentTheme === null || currentTheme === void 0 ? void 0 : currentTheme.id) === (globalTheme === null || globalTheme === void 0 ? void 0 : globalTheme.id);
1223
1226
  var isEditingCurrentlyAppliedTheme = themeId === (currentTheme === null || currentTheme === void 0 ? void 0 : currentTheme.id);
@@ -1267,12 +1270,12 @@ var Customize = function Customize(_ref) {
1267
1270
  });
1268
1271
  };
1269
1272
  useEffect(function () {
1270
- if (isNotNil(themeId) && !isLoading) {
1273
+ if (isNotNil(themeId) && !isLoadingTheme) {
1271
1274
  setThemeState({
1272
1275
  previewingTheme: themeData
1273
1276
  });
1274
1277
  }
1275
- }, [themeData, isLoading]);
1278
+ }, [isLoadingTheme]);
1276
1279
  if (isLoading) {
1277
1280
  return /*#__PURE__*/jsx(PageLoader, {});
1278
1281
  }
@@ -2075,11 +2078,7 @@ var Sidebar = function Sidebar(_ref) {
2075
2078
  });
2076
2079
  };
2077
2080
  var navigateToThemesScreen = function navigateToThemesScreen(themeId) {
2078
- setTheme(currentTheme);
2079
2081
  highlightTheme(isPresent(themeId) ? themeId : currentTheme === null || currentTheme === void 0 ? void 0 : currentTheme.id);
2080
- setThemeState({
2081
- previewingTheme: currentTheme
2082
- });
2083
2082
  history.push(buildUrl(buildPathname(routes.themes.index)));
2084
2083
  themeToEdit.current = null;
2085
2084
  };