Skip to content

Commit b82c0ec

Browse files
committed
Fix: adjust edition state
1 parent 6908459 commit b82c0ec

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

react/components/EditorContainer/Topbar/ContextSelectors/LocaleSelector.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,15 @@ const LocaleSelector: React.FC<Props> = ({
6666
if (locale !== culture.locale) {
6767
setLocale(culture.locale)
6868
}
69-
70-
if (editor.mode !== 'layout') editor.setMode('layout')
7169
// eslint-disable-next-line react-hooks/exhaustive-deps
7270
}, [culture.locale])
7371

72+
React.useEffect(() => {
73+
if (editor.mode !== 'content') {
74+
editor.setMode('content')
75+
}
76+
}, [culture.locale, culture.country])
77+
7478
const Selector = React.useCallback(
7579
() => (
7680
<div className={className}>

react/components/EditorContainer/Topbar/UrlInput.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@ const UrlInput = () => {
3838

3939
React.useEffect(() => {
4040
setUrl(urlPath)
41-
42-
if (editor.mode !== 'layout') editor.setMode('layout')
4341
}, [urlPath])
4442

4543
const onEnter = (

react/components/EditorProvider.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ class EditorProvider extends Component<Props, State> {
306306
}
307307

308308
public handleSetMode = (mode: EditorMode) => {
309-
this.setState({ mode, editMode: mode === 'content' ? true : false })
309+
this.setState({ mode, editMode: mode === 'content' ? false : true })
310310
}
311311

312312
public handleChangeIframeUrl = (url: string) => {

0 commit comments

Comments
 (0)