🐛 (editor) Fix lost changes when typebot takes a long time to update
Closes #1231
This commit is contained in:
@@ -208,7 +208,11 @@ export const TypebotProvider = ({
|
||||
const saveTypebot = useCallback(
|
||||
async (updates?: Partial<TypebotV6>) => {
|
||||
if (!localTypebot || !typebot || isReadOnly) return
|
||||
const typebotToSave = { ...localTypebot, ...updates }
|
||||
const typebotToSave = {
|
||||
...localTypebot,
|
||||
...updates,
|
||||
updatedAt: new Date(),
|
||||
}
|
||||
if (dequal(omit(typebot, 'updatedAt'), omit(typebotToSave, 'updatedAt')))
|
||||
return
|
||||
setLocalTypebot({ ...typebotToSave })
|
||||
|
||||
Reference in New Issue
Block a user