Discover surronding cells only on empty

This commit is contained in:
2024-02-18 17:47:52 +01:00
parent c2db839ebe
commit 049110e15e
+6 -1
View File
@@ -44,7 +44,12 @@ export const useActions = (grid: GridType, setGrid: React.Dispatch<React.SetStat
return revealAllGrid(grid, true); return revealAllGrid(grid, true);
} }
return discoverAroundCell(prev, rowIndex, colIndex); if (prev[rowIndex][colIndex].value === 'empty') {
return discoverAroundCell(prev, rowIndex, colIndex);
}
prev[rowIndex][colIndex].hidden = false;
return prev;
}); });
forceUpdate(); forceUpdate();
} }