Skip to content

Commit 369eb8c

Browse files
committed
fix: remove JS errors when we detach a protected & mirrored section
1 parent 3234fb6 commit 369eb8c

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
@@ -186,6 +186,7 @@ export default (services) => ({
186186
return !isBlank(section.mirrorOf)
187187
},
188188
isMirroredSectionEditable: ({ theme, section, page }, {}) => {
189+
if (section.mirrorOf.enabled === false) return true
189190
return theme.mirrorSection === true || (theme.mirrorSection === 'protected' && section.mirrorOf?.pageId === page.id)
190191
}
191192
})

0 commit comments

Comments
 (0)