preserve state of shape being edited during memo updates

This commit is contained in:
KDSBrowne 2022-11-16 04:12:28 +00:00
parent 7d4e50993f
commit 6ed2e47f1d

View File

@ -198,6 +198,10 @@ export default function Whiteboard(props) {
let changed = false;
if (next.pageStates[curPageId] && !_.isEqual(prevShapes, shapes)) {
const editingShape = tldrawAPI?.getShape(tldrawAPI?.getPageState()?.editingId);
if (editingShape) {
shapes[editingShape?.id] = editingShape;
}
// set shapes as locked for those who aren't allowed to edit it
Object.entries(shapes).forEach(([shapeId, shape]) => {
if (!shape.isLocked && !hasShapeAccess(shapeId)) {