2
0

fix(flow): 🐛 Fix save button

This commit is contained in:
Baptiste Arnaud
2022-01-21 09:06:57 +01:00
parent df2474ef43
commit 66f3e7ee7c

View File

@@ -6,6 +6,10 @@ import React from 'react'
export const SaveButton = () => { export const SaveButton = () => {
const { save, isSavingLoading, hasUnsavedChanges } = useTypebot() const { save, isSavingLoading, hasUnsavedChanges } = useTypebot()
const handleSaveClick = async () => {
await save()
}
return ( return (
<> <>
{hasUnsavedChanges && ( {hasUnsavedChanges && (
@@ -16,7 +20,7 @@ export const SaveButton = () => {
<Tooltip label="Save changes"> <Tooltip label="Save changes">
<IconButton <IconButton
isDisabled={!hasUnsavedChanges} isDisabled={!hasUnsavedChanges}
onClick={save} onClick={handleSaveClick}
isLoading={isSavingLoading} isLoading={isSavingLoading}
icon={ icon={
hasUnsavedChanges ? <SaveIcon /> : <CheckIcon color="green.400" /> hasUnsavedChanges ? <SaveIcon /> : <CheckIcon color="green.400" />