mirror of
https://github.com/christianvidalwolf-prog/Craze-Data-check.git
synced 2026-08-03 16:35:24 +02:00
fix: correctly track hasUnsavedChanges when only 1 pending change remains
This commit is contained in:
+1
-1
@@ -281,7 +281,7 @@ export default function App() {
|
||||
setAppState(prev => {
|
||||
const newData = [...prev.data];
|
||||
newData[pending.rowIndex] = pending.originalData;
|
||||
const stillPending = Object.keys(pendingRows).length > 1;
|
||||
const stillPending = Object.keys(pendingRows).length > 0;
|
||||
return { ...prev, data: newData, hasUnsavedChanges: stillPending };
|
||||
});
|
||||
setPendingRows(prev => { const n = { ...prev }; delete n[articleNo]; return n; });
|
||||
|
||||
Reference in New Issue
Block a user