Skip to content

Commit 4ba1724

Browse files
committed
fix: remove JS errors when we detach a protected & mirrored section
1 parent 623ffb7 commit 4ba1724

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

app/frontend/editor/components/section-pane/index.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,10 @@ export default {
9797
this.$refs.tabs.selectTab(this.findTabIndexFromRoute())
9898
},
9999
},
100+
isMirroredSectionEditable(newValue, oldValue) {
101+
if (newValue === false && oldValue === true)
102+
this.$refs.tabs.selectTab(0)
103+
}
100104
},
101105
}
102106
</script>

app/frontend/editor/store/getters.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,7 @@ export default (services) => ({
194194
return !isBlank(section.mirrorOf)
195195
},
196196
isMirroredSectionEditable: ({ theme, section, page }, {}) => {
197+
if (section.mirrorOf.enabled === false) return true
197198
return theme.mirrorSection === true || (theme.mirrorSection === 'protected' && section.mirrorOf?.pageId === page.id)
198199
}
199200
})

0 commit comments

Comments
 (0)