Fixed takeSnapshot deleting history if snapshot was equal to the previous

This commit is contained in:
Lucas Oliveira 2024-01-31 11:18:33 +01:00
commit f93724eb44

View file

@ -332,9 +332,11 @@ const useFlowsManagerStore = create<FlowsManagerStoreType>((set, get) => ({
const pastLength = past[currentFlowId]?.length ?? 0;
if (
pastLength > 0 &&
JSON.stringify(past[currentFlowId][pastLength - 1]) !==
JSON.stringify(past[currentFlowId][pastLength - 1]) ===
JSON.stringify(newState)
) {
)
return;
if (pastLength > 0) {
past[currentFlowId] = past[currentFlowId].slice(
pastLength - defaultOptions.maxHistorySize + 1,
pastLength