diff --git a/apps/studio/components/interfaces/Settings/General/Infrastructure/RestartServerButton.tsx b/apps/studio/components/interfaces/Settings/General/Infrastructure/RestartServerButton.tsx index 8eb59429c5b..75b9ad11351 100644 --- a/apps/studio/components/interfaces/Settings/General/Infrastructure/RestartServerButton.tsx +++ b/apps/studio/components/interfaces/Settings/General/Infrastructure/RestartServerButton.tsx @@ -12,7 +12,7 @@ import { import { useProjectRestartMutation } from 'data/projects/project-restart-mutation' import { useProjectRestartServicesMutation } from 'data/projects/project-restart-services-mutation' import { setProjectPostgrestStatus } from 'data/projects/projects-query' -import { useCheckPermissions } from 'hooks' +import { useCheckPermissions, useFlag } from 'hooks' import { Button, DropdownMenu, @@ -33,6 +33,7 @@ const RestartServerButton = () => { const projectRef = project?.ref ?? '' const projectRegion = project?.region ?? '' + const projectRestartDisabled = useFlag('disableProjectRestarts') const canRestartProject = useCheckPermissions(PermissionAction.INFRA_EXECUTE, 'reboot') const { mutate: restartProject, isLoading: isRestartingProject } = useProjectRestartMutation({ @@ -89,12 +90,17 @@ const RestartServerButton = () => { setServiceToRestart('project')} > Restart project - {canRestartProject && isProjectActive && ( + {canRestartProject && isProjectActive && !projectRestartDisabled && ( { )} + {projectRestartDisabled && ( + + + + + + Project restart is currently disabled + + + + + )}