redo/undo fix

This commit is contained in:
Guy Ben-Aharon
2024-09-09 16:23:47 +03:00
committed by Jonathan Fishner
parent b66758c7ed
commit b89a63553f
11 changed files with 102 additions and 168 deletions

View File

@@ -1,6 +1,6 @@
import React, { useCallback, useMemo, useState } from 'react';
import { DBTable } from '@/lib/domain/db-table';
import { generateId } from '@/lib/utils';
import { deepCopy, generateId } from '@/lib/utils';
import { randomColor } from '@/lib/colors';
import { ChartDBContext, chartDBContext } from './chartdb-context';
import { DatabaseType } from '@/lib/domain/database-type';
@@ -380,8 +380,7 @@ export const ChartDBProvider: React.FC<React.PropsWithChildren> = ({
);
};
const prevTables = [...tables];
// const updatedTablesAttrs = updateFn(tables);
const prevTables = deepCopy(tables);
const updatedTables = updateTables(tables);
setTables(updateTables);