From 269edcd0ee774997ad45c66b3120777559906970 Mon Sep 17 00:00:00 2001 From: Pablo Alba Date: Tue, 12 May 2026 10:32:12 +0200 Subject: [PATCH] :bug: Fix restore saved version keeps view-only (#9514) * :bug: Fix restore saved verrsion keeps view-only * :paperclip: Remove outdated note from CHANGES.md Remove note about restoring saved version from Preview mode. Signed-off-by: Andrey Antukh --------- Signed-off-by: Andrey Antukh Co-authored-by: Andrey Antukh --- CHANGES.md | 3 +-- frontend/src/app/main/data/workspace/versions.cljs | 6 ++++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 86166e6079..3af4938cac 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -25,7 +25,6 @@ - Fix copy and paste actions crashing the workspace on insecure origins (plain HTTP / non-`localhost`) where the Clipboard API is unavailable (by @MilosM348) [Github #6514](https://github.com/penpot/penpot/issues/6514) - Fix blend-mode dropdown leaving the canvas rendered with the last hover-preview blend mode when dismissed without selecting an option; the WASM render is now reverted to the saved blend mode on pointer-leave (by @edwin-rivera-dev) [Github #XXXX](https://github.com/penpot/penpot/issues/XXXX) - ## 2.16.0 (Unreleased) ### :boom: Breaking changes & Deprecations @@ -156,7 +155,7 @@ ### :sparkles: New features & Enhancements -- Add MCP server integration [Github #9174](https://github.com/penpot/penpot/issues/9174) +- Add MCP server integration [Github #9174](https://github.com/penpot/penpot/issues/9174) - Add chunked upload API for large media and binary files (removes previous upload size limits) [Github #8909](https://github.com/penpot/penpot/pull/8909) - Improve team name validation [Github #9176](https://github.com/penpot/penpot/pull/9176) diff --git a/frontend/src/app/main/data/workspace/versions.cljs b/frontend/src/app/main/data/workspace/versions.cljs index 933d5f8b5f..67b10ca760 100644 --- a/frontend/src/app/main/data/workspace/versions.cljs +++ b/frontend/src/app/main/data/workspace/versions.cljs @@ -180,6 +180,12 @@ [id] (assert (uuid? id) "expected valid uuid for `id`") (ptk/reify ::restore-version + ptk/UpdateEvent + (update [_ state] + ;; Clear preview state if we're restoring from preview mode + (-> state + (update :workspace-versions dissoc :backup) + (update :workspace-global dissoc :read-only? :preview-id))) ptk/WatchEvent (watch [_ state _] (let [file-id (:current-file-id state)]