0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2024-12-30 22:34:01 -05:00

Removed unnecessary active theme requests

This commit is contained in:
Sodbileg Gansukh 2024-12-16 13:07:12 +08:00
parent ab1f175a05
commit 1555b8953f
2 changed files with 0 additions and 6 deletions

View file

@ -1,7 +1,6 @@
import InvalidThemeModal, {FatalErrors} from './InvalidThemeModal';
import NiceModal from '@ebay/nice-modal-react';
import React from 'react';
import useCustomFonts from '../../../../hooks/useCustomFonts';
import {Button, ButtonProps, ConfirmationModal, List, ListItem, Menu, ModalPage, showToast} from '@tryghost/admin-x-design-system';
import {JSONError} from '@tryghost/admin-x-framework/errors';
import {Theme, isActiveTheme, isDefaultTheme, isDeletableTheme, isLegacyTheme, useActivateTheme, useDeleteTheme} from '@tryghost/admin-x-framework/api/themes';
@ -49,13 +48,11 @@ const ThemeActions: React.FC<ThemeActionProps> = ({
}) => {
const {mutateAsync: activateTheme} = useActivateTheme();
const {mutateAsync: deleteTheme} = useDeleteTheme();
const {refreshActiveThemeData} = useCustomFonts();
const handleError = useHandleError();
const handleActivate = async () => {
try {
await activateTheme(theme.name);
refreshActiveThemeData();
showToast({
title: 'Theme activated',
type: 'success',

View file

@ -1,6 +1,5 @@
import NiceModal from '@ebay/nice-modal-react';
import React, {ReactNode, useState} from 'react';
import useCustomFonts from '../../../../hooks/useCustomFonts';
import {Button, ConfirmationModalContent, Heading, List, ListItem, showToast} from '@tryghost/admin-x-design-system';
import {InstalledTheme, ThemeProblem, useActivateTheme} from '@tryghost/admin-x-framework/api/themes';
import {useHandleError} from '@tryghost/admin-x-framework/hooks';
@ -43,7 +42,6 @@ const ThemeInstalledModal: React.FC<{
onActivate?: () => void;
}> = ({title, prompt, installedTheme, onActivate}) => {
const {mutateAsync: activateTheme} = useActivateTheme();
const {refreshActiveThemeData} = useCustomFonts();
const handleError = useHandleError();
let errorPrompt = null;
@ -87,7 +85,6 @@ const ThemeInstalledModal: React.FC<{
try {
const resData = await activateTheme(installedTheme.name);
const updatedTheme = resData.themes[0];
refreshActiveThemeData();
showToast({
title: 'Theme activated',