Skip to content

Commit ff25bae

Browse files
author
Amelia Wattenberger
committed
fix: dont show rows without id as "old"
1 parent 2ec6f4a commit ff25bae

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

src/components/HtmlHistogram.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ export function HtmlHistogram(props: HistogramProps) {
3030
const height = 30;
3131

3232
const { bins } = useMemo(() => {
33-
console.log({ original, maxWidth, value })
3433
const maxBins = maxWidth
3534
? Math.max(0, Math.floor(maxWidth / 6) * 0.55)
3635
: 11;

src/store.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,12 +199,12 @@ export const createGridStore = () =>
199199
const modifiedFields = columnNames.filter((columnName) => {
200200
const type = draft.cellTypes[columnName];
201201
const oldValue =
202-
type === 'date' ? d[columnName].toString() : d[columnName];
202+
type === 'date' ? d[columnName]?.toString?.() : d[columnName];
203203
const newD = diffDataMap.get(id);
204204
const newValue =
205205
type === 'date'
206206
? // @ts-ignore
207-
newD[columnName].toString()
207+
newD[columnName]?.toString?.()
208208
: // @ts-ignore
209209
newD[columnName];
210210
return type === 'object'
@@ -222,7 +222,10 @@ export const createGridStore = () =>
222222
});
223223
const oldData = parseData(
224224
diffData
225-
.filter((d) => !newDataMap.get(d[idColumnName + '']))
225+
.filter(
226+
(d) =>
227+
!newDataMap.get(d[idColumnName + '']) && d[idColumnName || '']
228+
)
226229
.map((d) => ({ ...d, __status__: 'old' })),
227230
draft.cellTypes
228231
);

0 commit comments

Comments
 (0)