fix: i18n reversion (#860)
This commit is contained in:
parent
b3143148ab
commit
42ec8e8252
@ -4,7 +4,7 @@ import { ScrollSyncPane } from 'react-scroll-sync';
|
||||
import { EDITOR_SIZE_COMPACT } from '@staticcms/core/constants/views';
|
||||
import { summaryFormatter } from '@staticcms/core/lib/formatters';
|
||||
import useBreadcrumbs from '@staticcms/core/lib/hooks/useBreadcrumbs';
|
||||
import { getI18nInfo, hasI18n } from '@staticcms/core/lib/i18n';
|
||||
import { getI18nInfo, getPreviewEntry, hasI18n } from '@staticcms/core/lib/i18n';
|
||||
import classNames from '@staticcms/core/lib/util/classNames.util';
|
||||
import {
|
||||
getFileFromSlug,
|
||||
@ -305,6 +305,10 @@ const EditorInterface = ({
|
||||
[collection, entry, fields, fieldsErrors, handleLocaleChange, selectedLocale, submitted, t],
|
||||
);
|
||||
|
||||
const previewEntry = collectHasI18n
|
||||
? getPreviewEntry(entry, selectedLocale, defaultLocale)
|
||||
: entry;
|
||||
|
||||
const mobileLocaleEditor = useMemo(
|
||||
() => (
|
||||
<div
|
||||
@ -351,7 +355,7 @@ const EditorInterface = ({
|
||||
collection={collection}
|
||||
previewInFrame={previewInFrame}
|
||||
livePreviewUrlTemplate={livePreviewUrlTemplate}
|
||||
entry={entry}
|
||||
entry={previewEntry}
|
||||
fields={fields}
|
||||
editorSize={editorSize}
|
||||
showMobilePreview={showMobilePreview}
|
||||
|
Loading…
x
Reference in New Issue
Block a user