Fixed takeSnapshot deleting history if snapshot was equal to the previous
This commit is contained in:
parent
7ba2610184
commit
f93724eb44
1 changed files with 4 additions and 2 deletions
|
|
@ -332,9 +332,11 @@ const useFlowsManagerStore = create<FlowsManagerStoreType>((set, get) => ({
|
||||||
const pastLength = past[currentFlowId]?.length ?? 0;
|
const pastLength = past[currentFlowId]?.length ?? 0;
|
||||||
if (
|
if (
|
||||||
pastLength > 0 &&
|
pastLength > 0 &&
|
||||||
JSON.stringify(past[currentFlowId][pastLength - 1]) !==
|
JSON.stringify(past[currentFlowId][pastLength - 1]) ===
|
||||||
JSON.stringify(newState)
|
JSON.stringify(newState)
|
||||||
) {
|
)
|
||||||
|
return;
|
||||||
|
if (pastLength > 0) {
|
||||||
past[currentFlowId] = past[currentFlowId].slice(
|
past[currentFlowId] = past[currentFlowId].slice(
|
||||||
pastLength - defaultOptions.maxHistorySize + 1,
|
pastLength - defaultOptions.maxHistorySize + 1,
|
||||||
pastLength
|
pastLength
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue