Show loading icon when saving the workflow (#1740)

This commit is contained in:
Shuchang Zheng
2025-02-07 00:39:44 +08:00
committed by GitHub
parent 1f308fffc4
commit cd64639faa
3 changed files with 14 additions and 2 deletions

View File

@@ -603,6 +603,7 @@ function FlowRenderer({
<Panel position="top-center" className="h-20">
<WorkflowHeader
title={title}
saving={saveWorkflowMutation.isPending}
onTitleChange={(newTitle) => {
setTitle(newTitle);
setHasChanges(true);

View File

@@ -25,6 +25,7 @@ type Props = {
onParametersClick: () => void;
onSave: () => void;
onTitleChange: (title: string) => void;
saving: boolean;
};
function WorkflowHeader({
@@ -33,6 +34,7 @@ function WorkflowHeader({
onParametersClick,
onSave,
onTitleChange,
saving,
}: Props) {
const { workflowPermanentId } = useParams();
const { data: globalWorkflows } = useGlobalWorkflowsQuery();
@@ -95,7 +97,11 @@ function WorkflowHeader({
onSave();
}}
>
<SaveIcon />
{saving ? (
<ReloadIcon className="size-6 animate-spin" />
) : (
<SaveIcon className="size-6" />
)}
</Button>
</TooltipTrigger>
<TooltipContent>Save</TooltipContent>