From 6c15d9948bdafd80cf6aa49e3be5f925521c1b0b Mon Sep 17 00:00:00 2001 From: David Luzar Date: Wed, 2 Nov 2022 14:39:12 +0100 Subject: [PATCH] fix: syncing 1-point lines to remote clients (#5677) --- src/actions/actionDeleteSelected.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/actions/actionDeleteSelected.tsx b/src/actions/actionDeleteSelected.tsx index dfba34df..0dd77f4a 100644 --- a/src/actions/actionDeleteSelected.tsx +++ b/src/actions/actionDeleteSelected.tsx @@ -78,7 +78,12 @@ export const actionDeleteSelected = register({ // case: deleting last remaining point element.points.length < 2 ) { - const nextElements = elements.filter((el) => el.id !== element.id); + const nextElements = elements.map((el) => { + if (el.id === element.id) { + return newElementWith(el, { isDeleted: true }); + } + return el; + }); const nextAppState = handleGroupEditingState(appState, nextElements); return {