@bigbinary/neeto-themes-frontend 4.2.4-beta1 → 4.2.4-beta3

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.
@@ -1454,9 +1454,13 @@ var Customize = function Customize(_ref) {
1454
1454
  _useListThemes$data2$ = _useListThemes$data2.defaultThemes,
1455
1455
  defaultThemes = _useListThemes$data2$ === void 0 ? [] : _useListThemes$data2$,
1456
1456
  isLoadingSystemThemes = _useListThemes.isLoading;
1457
- var themeToCustomize = isCustomizingSystemTheme ? buildSystemThemeCopy(neetoCist.findBy({
1457
+ var sourceTheme = isCustomizingSystemTheme ? neetoCist.findBy({
1458
1458
  id: sourceThemeId
1459
- }, defaultThemes)) : themeData;
1459
+ }, defaultThemes) : null;
1460
+ var systemThemeCopy = react.useMemo(function () {
1461
+ return buildSystemThemeCopy(sourceTheme);
1462
+ }, [sourceTheme === null || sourceTheme === void 0 ? void 0 : sourceTheme.id]);
1463
+ var themeToCustomize = isCustomizingSystemTheme ? systemThemeCopy : themeData;
1460
1464
  var isLoading = isFetchingSchema || isLoadingTheme || isCustomizingSystemTheme && isLoadingSystemThemes;
1461
1465
  var isThemeGlobalTheme = themeId && (globalTheme === null || globalTheme === void 0 ? void 0 : globalTheme.id) === themeId;
1462
1466
  var isCurrentThemeAndGlobalThemeSame = (currentTheme === null || currentTheme === void 0 ? void 0 : currentTheme.id) === (globalTheme === null || globalTheme === void 0 ? void 0 : globalTheme.id);
@@ -1502,10 +1506,16 @@ var Customize = function Customize(_ref) {
1502
1506
  onApplyThemeSuccess === null || onApplyThemeSuccess === void 0 || onApplyThemeSuccess(theme);
1503
1507
  case 9:
1504
1508
  onCreateTheme(theme);
1509
+ if (isNewThemeRoute()) {
1510
+ _context.next = 12;
1511
+ break;
1512
+ }
1513
+ return _context.abrupt("return");
1514
+ case 12:
1505
1515
  history.replace(utils$1.buildUrl(buildPathname(useGlobalThemesApi.routes.themes.edit), {
1506
1516
  themeId: theme.id
1507
1517
  }));
1508
- case 11:
1518
+ case 13:
1509
1519
  case "end":
1510
1520
  return _context.stop();
1511
1521
  }