From 3acdf56679c8f3d8708dba5b55dd895fa59a5c4a Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Tue, 16 Nov 2021 13:35:20 +0000 Subject: [PATCH] Precent unecessary client app builder store updates to improve performance --- packages/client/src/stores/builder.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/client/src/stores/builder.js b/packages/client/src/stores/builder.js index 22ee7b43b5..08ac6ba906 100644 --- a/packages/client/src/stores/builder.js +++ b/packages/client/src/stores/builder.js @@ -80,9 +80,15 @@ const createBuilderStore = () => { }) }, setDragging: dragging => { + if (dragging === get(writableStore).isDragging) { + return + } writableStore.update(state => ({ ...state, isDragging: dragging })) }, setEditMode: enabled => { + if (enabled === get(writableStore).editMode) { + return + } writableStore.update(state => ({ ...state, editMode: enabled })) }, }