Skip to content

Commit 1d2138a

Browse files
authored
fix: Fast switch between selected instances (#4545)
## Description Removes display etc fast switching changes on instance change. ## Steps for reproduction 1. click button 2. expect xyz ## Code Review - [ ] hi @kof, I need you to do - conceptual review (architecture, feature-correctness) - detailed review (read every line) - test it on preview ## Before requesting a review - [ ] made a self-review - [ ] added inline comments where things may be not obvious (the "why", not "what") ## Before merging - [ ] tested locally and on preview environment (preview dev login: 0000) - [ ] updated [test cases](https://github.com/webstudio-is/webstudio/blob/main/apps/builder/docs/test-cases.md) document - [ ] added tests - [ ] if any new env variables are added, added them to `.env` file
1 parent 4c04c36 commit 1d2138a

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

apps/builder/app/canvas/instance-selected.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -247,11 +247,6 @@ const subscribeSelectedInstance = (
247247

248248
let updateStoreTimeouHandle: undefined | ReturnType<typeof setTimeout>;
249249

250-
const updateStoresDebounced = () => {
251-
clearTimeout(updateStoreTimeouHandle);
252-
updateStoreTimeouHandle = setTimeout(updateStores, 100);
253-
};
254-
255250
const update = () => {
256251
debounceEffect(() => {
257252
updateElements();
@@ -262,9 +257,7 @@ const subscribeSelectedInstance = (
262257
// getBoundingClientRect is used instead.
263258
showOutline();
264259

265-
// Cause serious performance issues, use debounced version
266-
// The result of stores is not needed immediately
267-
updateStoresDebounced();
260+
updateStores();
268261

269262
// Having that elements can be changed (i.e. div => address tag change, observe again)
270263
updateObservers();

0 commit comments

Comments
 (0)