@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.
@@ -1476,9 +1476,13 @@ var Customize = function Customize(_ref) {
1476
1476
  _useListThemes$data2$ = _useListThemes$data2.defaultThemes,
1477
1477
  defaultThemes = _useListThemes$data2$ === void 0 ? [] : _useListThemes$data2$,
1478
1478
  isLoadingSystemThemes = _useListThemes.isLoading;
1479
- var themeToCustomize = isCustomizingSystemTheme ? buildSystemThemeCopy(neetoCist.findBy({
1479
+ var sourceTheme = isCustomizingSystemTheme ? neetoCist.findBy({
1480
1480
  id: sourceThemeId
1481
- }, defaultThemes)) : themeData;
1481
+ }, defaultThemes) : null;
1482
+ var systemThemeCopy = react.useMemo(function () {
1483
+ return buildSystemThemeCopy(sourceTheme);
1484
+ }, [sourceTheme === null || sourceTheme === void 0 ? void 0 : sourceTheme.id]);
1485
+ var themeToCustomize = isCustomizingSystemTheme ? systemThemeCopy : themeData;
1482
1486
  var isLoading = isFetchingSchema || isLoadingTheme || isCustomizingSystemTheme && isLoadingSystemThemes;
1483
1487
  var isThemeGlobalTheme = themeId && (globalTheme === null || globalTheme === void 0 ? void 0 : globalTheme.id) === themeId;
1484
1488
  var isCurrentThemeAndGlobalThemeSame = (currentTheme === null || currentTheme === void 0 ? void 0 : currentTheme.id) === (globalTheme === null || globalTheme === void 0 ? void 0 : globalTheme.id);
@@ -1528,10 +1532,16 @@ var Customize = function Customize(_ref) {
1528
1532
  onApplyThemeSuccess === null || onApplyThemeSuccess === void 0 || onApplyThemeSuccess(theme);
1529
1533
  case 9:
1530
1534
  onCreateTheme(theme);
1535
+ if (isNewThemeRoute()) {
1536
+ _context.next = 12;
1537
+ break;
1538
+ }
1539
+ return _context.abrupt("return");
1540
+ case 12:
1531
1541
  history.replace(utils$1.buildUrl(buildPathname(useGlobalThemesApi.routes.themes.edit), {
1532
1542
  themeId: theme.id
1533
1543
  }));
1534
- case 11:
1544
+ case 13:
1535
1545
  case "end":
1536
1546
  return _context.stop();
1537
1547
  }