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:
parent
ab1f175a05
commit
1555b8953f
2 changed files with 0 additions and 6 deletions
|
@ -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',
|
||||
|
|
|
@ -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',
|
||||
|
|
Loading…
Reference in a new issue