Skip to content

Commit

Permalink
Merge pull request #6972 from getkirby/fix/vanishing-change
Browse files Browse the repository at this point in the history
Fix disappearing writer content
  • Loading branch information
bastianallgeier authored Feb 6, 2025
2 parents a740272 + e5548c9 commit 72a795f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
3 changes: 3 additions & 0 deletions panel/src/components/Sections/FieldsSection.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ import debounce from "@/helpers/debounce.js";
export default {
mixins: [SectionMixin],
inheritAttrs: false,
props: {
lock: [Object, Boolean]
},
data() {
return {
fields: {},
Expand Down
9 changes: 7 additions & 2 deletions panel/src/store/modules/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,13 +139,18 @@ export default {
MOVE(state, [from, to]) {
// move state
const model = structuredClone(state.models[from]);
del(state.models, from);
set(state.models, to, model);

// move local storage
const storage = localStorage.getItem("kirby$content$" + from);
localStorage.removeItem("kirby$content$" + from);
localStorage.setItem("kirby$content$" + to, storage);

// change the context
state.current = to;

// delete the old state
localStorage.removeItem("kirby$content$" + from);
del(state.models, from);
},
REMOVE(state, id) {
del(state.models, id);
Expand Down

0 comments on commit 72a795f

Please sign in to comment.