Skip to content

Commit af2fa5d

Browse files
committed
fix(studio): the preview sync after a painted-back undo has nothing left to redraw
1 parent 9a56452 commit af2fa5d

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

‎packages/studio/src/hooks/useEditHistoryActions.ts‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,8 @@ export function useEditHistoryActions({
106106
return;
107107
}
108108
if (result.ok && result.label) {
109-
const files =
110-
serverSteppedShown && predictedShown
111-
? fromShown(result.files, predicted!.files)
112-
: result.files;
109+
const shown = predictedShown ? predicted!.files : result.files;
110+
const files = serverSteppedShown && shown ? fromShown(result.files, shown) : result.files;
113111
const restore = { paths: result.paths, files };
114112
onAfterUndoRedo?.(restore);
115113
if (activeCompPath && result.paths?.includes(activeCompPath)) {

0 commit comments

Comments
 (0)